Solve elm test bugs from moving user

4-transfer-api
Bram 2024-07-19 09:02:01 +02:00
parent 8b2db7bff6
commit 3566d3ee7a
3 changed files with 12 additions and 10 deletions

View File

@ -8,6 +8,7 @@ import Internal.Values.Context as Context exposing (Context, Versions)
import Set
import Test exposing (..)
import Test.Tools.Timestamp as TestTimestamp
import Test.Values.User as TestUser
fuzzer : Fuzzer Context
@ -17,22 +18,25 @@ fuzzer =
maybeString =
Fuzz.maybe Fuzz.string
in
Fuzz.map8 (\a b c d ( e, f ) ( g, h ) ( i, j ) ( k, l ) -> Context a b c d e f g h i j k l)
Fuzz.map8 (\a b c ( d, e ) ( f, g ) ( h, i ) ( j, k ) ( l, m ) -> Context a b c d e f g h i j k l m)
(Fuzz.constant <| Hashdict.empty .value)
maybeString
maybeString
maybeString
(Fuzz.pair
maybeString
(Fuzz.maybe TestTimestamp.fuzzer)
maybeString
)
(Fuzz.pair
maybeString
maybeString
)
(Fuzz.pair
Fuzz.string
maybeString
)
(Fuzz.pair
maybeString
maybeString
(Fuzz.maybe TestUser.fuzzer)
)
(Fuzz.pair
maybeString

View File

@ -25,7 +25,7 @@ suite =
[ fuzz Fuzz.string
"currentVersion"
(\s ->
{ content = s, serverName = "" }
{ content = s, serverName = "", user = Nothing }
|> Envelope.init
|> Envelope.extractSettings .currentVersion
|> Expect.equal Default.currentVersion
@ -33,7 +33,7 @@ suite =
, fuzz Fuzz.string
"deviceName"
(\s ->
{ content = s, serverName = "" }
{ content = s, serverName = "", user = Nothing }
|> Envelope.init
|> Envelope.extractSettings .deviceName
|> Expect.equal Default.deviceName
@ -41,7 +41,7 @@ suite =
, fuzz Fuzz.string
"syncTime"
(\s ->
{ content = s, serverName = "" }
{ content = s, serverName = "", user = Nothing }
|> Envelope.init
|> Envelope.extractSettings .syncTime
|> Expect.equal Default.syncTime

View File

@ -7,12 +7,11 @@ import Internal.Values.Vault exposing (Vault)
import Test exposing (..)
import Test.Tools.Hashdict as TestHashdict
import Test.Values.Room as TestRoom
import Test.Values.User as TestUser
vault : Fuzzer Vault
vault =
Fuzz.map4 Vault
Fuzz.map3 Vault
(Fuzz.string
|> Fuzz.map (\k -> ( k, Json.encode Json.int 0 ))
|> Fuzz.list
@ -20,4 +19,3 @@ vault =
)
(Fuzz.maybe Fuzz.string)
(TestHashdict.fuzzer .roomId TestRoom.fuzzer)
(Fuzz.maybe TestUser.fuzzer)