Refactor test suite
parent
bf64d5911f
commit
fa642b46d6
|
@ -0,0 +1,35 @@
|
|||
module Test.Matrix.Settings exposing (..)
|
||||
|
||||
import Expect
|
||||
import Fuzz
|
||||
import Matrix.Settings
|
||||
import Test exposing (..)
|
||||
import Test.Types as TestTypes
|
||||
|
||||
|
||||
settings : Test
|
||||
settings =
|
||||
describe "Exposed Matrix.Settings"
|
||||
[ describe "Set values"
|
||||
[ fuzz2 TestTypes.vault
|
||||
Fuzz.string
|
||||
"Set device name"
|
||||
(\vault name ->
|
||||
vault
|
||||
|> Matrix.Settings.setDeviceName name
|
||||
|> Matrix.Settings.getDeviceName
|
||||
|> Expect.equal name
|
||||
)
|
||||
, fuzz2 TestTypes.vault
|
||||
Fuzz.int
|
||||
"Set sync time"
|
||||
(\vault sync ->
|
||||
vault
|
||||
|> Matrix.Settings.setSyncTime sync
|
||||
|> Matrix.Settings.getSyncTime
|
||||
|> Expect.equal sync
|
||||
)
|
||||
]
|
||||
|
||||
-- , describe "Read values" []
|
||||
]
|
|
@ -1,4 +1,4 @@
|
|||
module Iddict exposing (..)
|
||||
module Test.Tools.Iddict exposing (..)
|
||||
|
||||
import Expect
|
||||
import Fuzz exposing (Fuzzer)
|
|
@ -0,0 +1,17 @@
|
|||
module Test.Types exposing (..)
|
||||
|
||||
import Fuzz exposing (Fuzzer)
|
||||
import Test.Values.Envelope as TestEnvelope
|
||||
import Test.Values.Event as TestEvent
|
||||
import Test.Values.Vault as TestVault
|
||||
import Types exposing (..)
|
||||
|
||||
|
||||
event : Fuzzer Event
|
||||
event =
|
||||
Fuzz.map Event (TestEnvelope.fuzzer TestEvent.fuzzer)
|
||||
|
||||
|
||||
vault : Fuzzer Vault
|
||||
vault =
|
||||
Fuzz.map Vault (TestEnvelope.fuzzer TestVault.vault)
|
|
@ -0,0 +1,10 @@
|
|||
module Test.Values.Vault exposing (..)
|
||||
|
||||
import Fuzz exposing (Fuzzer)
|
||||
import Internal.Values.Vault exposing (Vault)
|
||||
import Test exposing (..)
|
||||
|
||||
|
||||
vault : Fuzzer Vault
|
||||
vault =
|
||||
Fuzz.unit
|
|
@ -1,53 +0,0 @@
|
|||
module Vault exposing (..)
|
||||
|
||||
import Expect
|
||||
import Fuzz exposing (Fuzzer)
|
||||
import Internal.Config.Default as Default
|
||||
import Internal.Values.Envelope as Envelope
|
||||
import Matrix
|
||||
import Matrix.Settings
|
||||
import Test exposing (..)
|
||||
import Types
|
||||
|
||||
|
||||
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
|
||||
)
|
||||
]
|
Loading…
Reference in New Issue