diff --git a/tests/Vault.elm b/tests/Vault.elm new file mode 100644 index 0000000..475375b --- /dev/null +++ b/tests/Vault.elm @@ -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 + ) + ] \ No newline at end of file