From ca0a7b41df3e26685f357a1d107454021d71a2a8 Mon Sep 17 00:00:00 2001 From: Bram Date: Thu, 21 Dec 2023 22:39:30 +0100 Subject: [PATCH] Add Matrix.Settings test --- tests/Vault.elm | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/Vault.elm 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