mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-25 12:52:27 +03:00
Fix a test case.
This commit is contained in:
parent
7afbd8188e
commit
c48cec7cde
@ -287,39 +287,39 @@ all =
|
||||
}
|
||||
(StringBody "This is a raw text file.")
|
||||
|> expectSuccess []
|
||||
, skip <|
|
||||
test "Err in String to Result function turns into decode error" <|
|
||||
\() ->
|
||||
startSimple []
|
||||
(DataSource.Http.request
|
||||
{ url = "https://example.com/file.txt"
|
||||
, method = "GET"
|
||||
, headers = []
|
||||
, body = DataSource.Http.emptyBody
|
||||
}
|
||||
(DataSource.Http.expectString
|
||||
(\string ->
|
||||
if String.toUpper string == string then
|
||||
Ok string
|
||||
, test "Err in String to Result function turns into decode error" <|
|
||||
\() ->
|
||||
startSimple []
|
||||
(DataSource.Http.request
|
||||
{ url = "https://example.com/file.txt"
|
||||
, method = "GET"
|
||||
, headers = []
|
||||
, body = DataSource.Http.emptyBody
|
||||
}
|
||||
(DataSource.Http.expectString
|
||||
(\string ->
|
||||
if String.toUpper string == string then
|
||||
Ok string
|
||||
|
||||
else
|
||||
Err "String was not uppercased"
|
||||
)
|
||||
else
|
||||
Err "String was not uppercased"
|
||||
)
|
||||
)
|
||||
|> simulateHttp
|
||||
(get "https://example.com/file.txt")
|
||||
(StringBody "This is a raw text file.")
|
||||
|> ProgramTest.expectOutgoingPortValues
|
||||
"toJsPort"
|
||||
(Codec.decoder (ToJsPayload.successCodecNew2 "" ""))
|
||||
(expectErrorsPort
|
||||
"""-- STATIC HTTP DECODING ERROR ----------------------------------------------------- elm-pages
|
||||
|> DataSource.andThen DataSource.fromResult
|
||||
)
|
||||
|> simulateHttp
|
||||
(get "https://example.com/file.txt")
|
||||
(StringBody "This is a raw text file.")
|
||||
|> ProgramTest.expectOutgoingPortValues
|
||||
"toJsPort"
|
||||
(Codec.decoder (ToJsPayload.successCodecNew2 "" ""))
|
||||
(expectErrorsPort
|
||||
"""-- CALLED STATIC HTTP FAIL ----------------------------------------------------- elm-pages
|
||||
|
||||
|
||||
|
||||
String was not uppercased"""
|
||||
)
|
||||
I ran into a call to `DataSource.fail` with message: String was not uppercased"""
|
||||
)
|
||||
, test "POST method works" <|
|
||||
\() ->
|
||||
startSimple []
|
||||
|
Loading…
Reference in New Issue
Block a user