mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-24 20:31:42 +03:00
Simplify test helper.
This commit is contained in:
parent
35e2c2ca51
commit
56718bb708
@ -339,30 +339,24 @@ expectSuccess expectedRequests previous =
|
||||
(\value ->
|
||||
case value of
|
||||
[ portPayload ] ->
|
||||
portPayload
|
||||
|> Expect.all
|
||||
[ \subject ->
|
||||
Dict.fromList
|
||||
[ ( subject.route, subject.contentJson )
|
||||
]
|
||||
|> Expect.equalDicts
|
||||
(expectedRequests
|
||||
Dict.fromList
|
||||
[ ( portPayload.route, portPayload.contentJson )
|
||||
]
|
||||
|> Expect.equalDicts
|
||||
(expectedRequests
|
||||
|> List.map
|
||||
(\( url, requests ) ->
|
||||
( url
|
||||
, requests
|
||||
|> List.map
|
||||
(\( url, requests ) ->
|
||||
( url
|
||||
, requests
|
||||
|> List.map
|
||||
(\( request, response ) ->
|
||||
( Request.hash request, response )
|
||||
)
|
||||
|> Dict.fromList
|
||||
)
|
||||
(\( request, response ) ->
|
||||
( Request.hash request, response )
|
||||
)
|
||||
|> Dict.fromList
|
||||
)
|
||||
|
||||
--:: expectations
|
||||
]
|
||||
)
|
||||
|> 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