Adjust tests

This commit is contained in:
Steven Vandevelde 2020-03-11 17:03:47 +01:00
parent 6cd14f53ef
commit 07c001d998

View File

@ -42,7 +42,7 @@ all =
"https://api.github.com/repos/dillonkearns/elm-pages"
"""{ "stargazer_count": 86 }"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """{"stargazer_count":86}"""
)
@ -69,7 +69,7 @@ all =
"NEXT-REQUEST"
"""null"""
|> expectSuccess
[ ( "/elm-pages"
[ ( "elm-pages"
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """null"""
)
@ -162,7 +162,7 @@ all =
"url10"
"""{"image": "image10.jpg"}"""
|> expectSuccess
[ ( "/elm-pages"
[ ( "elm-pages"
, [ ( get "https://pokeapi.co/api/v2/pokemon/"
, """[{"url":"url1"},{"url":"url2"},{"url":"url3"},{"url":"url4"},{"url":"url5"},{"url":"url6"},{"url":"url7"},{"url":"url8"},{"url":"url9"},{"url":"url10"}]"""
)
@ -218,13 +218,13 @@ all =
"https://api.github.com/repos/dillonkearns/elm-pages-starter"
"""{ "stargazer_count": 22 }"""
|> expectSuccess
[ ( "/elm-pages"
[ ( "elm-pages"
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """{"stargazer_count":86}"""
)
]
)
, ( "/elm-pages-starter"
, ( "elm-pages-starter"
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages-starter"
, """{"stargazer_count":22}"""
)
@ -243,7 +243,7 @@ all =
"https://api.github.com/repos/dillonkearns/elm-pages"
"""{ "stargazer_count": 86, "unused_field": 123 }"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """{"stargazer_count":86}"""
)
@ -272,7 +272,7 @@ all =
"https://api.github.com/repos/dillonkearns/elm-pages"
"""{ "stargazer_count": 86, "unused_field": 123 }"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """{ "stargazer_count": 86, "unused_field": 123 }"""
)
@ -299,7 +299,7 @@ all =
"https://example.com/file.txt"
"This is a raw text file."
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "https://example.com/file.txt"
, "This is a raw text file."
)
@ -339,7 +339,7 @@ all =
(expectErrorsPort
"""-- STATIC HTTP DECODING ERROR ----------------------------------------------------- elm-pages
/
String was not uppercased"""
)
@ -363,7 +363,7 @@ String was not uppercased"""
"https://api.github.com/repos/dillonkearns/elm-pages"
"""{ "stargazer_count": 86, "unused_field": 123 }"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( { method = "POST"
, url = "https://api.github.com/repos/dillonkearns/elm-pages"
, headers = []
@ -394,7 +394,7 @@ String was not uppercased"""
"https://api.github.com/repos/dillonkearns/elm-pages-starter"
"""{ "stargazer_count": 50, "unused_field": 456 }"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """{"stargazer_count":100}"""
)
@ -422,7 +422,7 @@ String was not uppercased"""
"https://api.github.com/repos/dillonkearns/elm-pages-starter"
"""{ "stargazer_count": 50, "unused_field": 456 }"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "https://api.github.com/repos/dillonkearns/elm-pages"
, """{"stargazer_count":100}"""
)
@ -439,7 +439,7 @@ String was not uppercased"""
, StaticHttp.succeed ()
)
]
|> expectSuccess [ ( "/", [] ) ]
|> expectSuccess [ ( "", [] ) ]
, test "the port sends out when there are duplicate http requests for the same page" <|
\() ->
start
@ -454,7 +454,7 @@ String was not uppercased"""
"http://example.com"
"""null"""
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( get "http://example.com"
, """null"""
)
@ -478,7 +478,7 @@ String was not uppercased"""
(expectErrorsPort
"""-- STATIC HTTP DECODING ERROR ----------------------------------------------------- elm-pages
/elm-pages
elm-pages
I encountered some errors while decoding this JSON:
@ -591,7 +591,7 @@ Body: """)
}
)
|> expectSuccess
[ ( "/"
[ ( ""
, [ ( { method = "GET"
, url = "https://api.github.com/repos/dillonkearns/elm-pages?apiKey=<API_KEY>"
, headers =
@ -650,7 +650,6 @@ start pages =
|> Dict.get
(page.path
|> PagePath.toString
|> String.dropLeft 1
|> String.split "/"
|> List.filter (\pathPart -> pathPart /= "")
)
@ -806,7 +805,7 @@ starDecoder =
thingy =
[ ( "/"
[ ( ""
, [ ( { method = "GET"
, url = "https://api.github.com/repos/dillonkearns/elm-pages"
, headers = []