elm-matrix-sdk-beta/tests/Vault.elm

54 lines
1.4 KiB
Elm
Raw Normal View History

2023-12-21 21:39:30 +00:00
module Vault exposing (..)
import Expect
import Fuzz exposing (Fuzzer)
2023-12-21 22:17:34 +00:00
import Internal.Config.Default as Default
import Internal.Values.Envelope as Envelope
2023-12-21 21:39:30 +00:00
import Matrix
import Matrix.Settings
import Test exposing (..)
import Types
2023-12-21 22:17:34 +00:00
2023-12-21 21:39:30 +00:00
fuzzer : Fuzzer Matrix.Vault
fuzzer =
Fuzz.constant <| Types.Vault <| Envelope.init {}
2023-12-21 22:17:34 +00:00
2023-12-21 21:39:30 +00:00
settings : Test
settings =
describe "Edit settings"
2023-12-21 22:17:34 +00:00
[ fuzz fuzzer
"Default device name"
2023-12-21 21:39:30 +00:00
(\vault ->
vault
|> Matrix.Settings.getDeviceName
|> Expect.equal Default.deviceName
)
2023-12-21 22:17:34 +00:00
, fuzz2 fuzzer
Fuzz.string
"Set device name"
2023-12-21 21:39:30 +00:00
(\vault name ->
vault
|> Matrix.Settings.setDeviceName name
|> Matrix.Settings.getDeviceName
|> Expect.equal name
)
2023-12-21 22:17:34 +00:00
, fuzz fuzzer
"Default sync time"
2023-12-21 21:39:30 +00:00
(\vault ->
vault
|> Matrix.Settings.getSyncTime
|> Expect.equal Default.syncTime
)
2023-12-21 22:17:34 +00:00
, fuzz2 fuzzer
Fuzz.int
"Set sync time"
2023-12-21 21:39:30 +00:00
(\vault sync ->
vault
|> Matrix.Settings.setSyncTime sync
|> Matrix.Settings.getSyncTime
|> Expect.equal sync
)
2023-12-21 22:17:34 +00:00
]