mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-25 21:02:33 +03:00
Assert for multiple ports.
This commit is contained in:
parent
56718bb708
commit
bf68b2eb47
@ -336,12 +336,11 @@ expectSuccess expectedRequests previous =
|
|||||||
|> ProgramTest.expectOutgoingPortValues
|
|> ProgramTest.expectOutgoingPortValues
|
||||||
"toJsPort"
|
"toJsPort"
|
||||||
(Codec.decoder ToJsPayload.successCodecNew)
|
(Codec.decoder ToJsPayload.successCodecNew)
|
||||||
(\value ->
|
(\portPayloads ->
|
||||||
case value of
|
portPayloads
|
||||||
[ portPayload ] ->
|
|> List.map
|
||||||
Dict.fromList
|
(\portPayload -> ( portPayload.route, portPayload.contentJson ))
|
||||||
[ ( portPayload.route, portPayload.contentJson )
|
|> Dict.fromList
|
||||||
]
|
|
||||||
|> Expect.equalDicts
|
|> Expect.equalDicts
|
||||||
(expectedRequests
|
(expectedRequests
|
||||||
|> List.map
|
|> List.map
|
||||||
@ -357,9 +356,6 @@ expectSuccess expectedRequests previous =
|
|||||||
)
|
)
|
||||||
|> Dict.fromList
|
|> Dict.fromList
|
||||||
)
|
)
|
||||||
|
|
||||||
_ ->
|
|
||||||
Expect.fail ("Expected ports to be called once, but instead there were " ++ String.fromInt (List.length value) ++ " calls.")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user