Add Matrix.Settings test

pull/3/head
Bram 2023-12-21 22:39:30 +01:00
parent 4e68dfbcbd
commit ca0a7b41df
1 changed files with 45 additions and 0 deletions

45
tests/Vault.elm Normal file
View File

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