mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-28 06:12:33 +03:00
Apply some elm-review fixes.
This commit is contained in:
parent
a03b0295bc
commit
9619e3e199
1
elm.json
1
elm.json
@ -53,7 +53,6 @@
|
||||
"noahzgordon/elm-color-extra": "1.0.2 <= v < 2.0.0",
|
||||
"robinheghan/murmur3": "1.0.0 <= v < 2.0.0",
|
||||
"stil4m/elm-syntax": "7.2.7 <= v < 8.0.0",
|
||||
"tripokey/elm-fuzzy": "5.2.1 <= v < 6.0.0",
|
||||
"turboMaCk/non-empty-list-alias": "1.2.0 <= v < 2.0.0",
|
||||
"vito/elm-ansi": "10.0.1 <= v < 11.0.0"
|
||||
},
|
||||
|
@ -89,12 +89,12 @@ all =
|
||||
)
|
||||
)
|
||||
|> literal "no-dynamic-segments.json"
|
||||
|> ApiRoute.serverRender
|
||||
|> serverRender
|
||||
|> Internal.ApiRoute.toPattern
|
||||
|> Expect.equal (Pattern [ Pattern.Literal "no-dynamic-segments.json" ] Pattern.NoPendingSlash)
|
||||
, test "two literal segments" <|
|
||||
\() ->
|
||||
ApiRoute.succeed
|
||||
succeed
|
||||
(Server.Request.succeed ()
|
||||
|> Server.Request.map
|
||||
(\() ->
|
||||
@ -103,10 +103,10 @@ all =
|
||||
|> DataSource.succeed
|
||||
)
|
||||
)
|
||||
|> ApiRoute.literal "api"
|
||||
|> ApiRoute.slash
|
||||
|> ApiRoute.literal "stars"
|
||||
|> ApiRoute.serverRender
|
||||
|> literal "api"
|
||||
|> slash
|
||||
|> literal "stars"
|
||||
|> serverRender
|
||||
|> Internal.ApiRoute.toPattern
|
||||
|> Expect.equal
|
||||
(Pattern
|
||||
@ -154,12 +154,12 @@ all =
|
||||
DataSource.succeed ("Data for repo " ++ repo |> Server.Response.plainText)
|
||||
)
|
||||
)
|
||||
|> ApiRoute.literal "api"
|
||||
|> ApiRoute.slash
|
||||
|> ApiRoute.literal "repo"
|
||||
|> ApiRoute.slash
|
||||
|> ApiRoute.capture
|
||||
|> ApiRoute.literal ".json"
|
||||
|> literal "api"
|
||||
|> slash
|
||||
|> literal "repo"
|
||||
|> slash
|
||||
|> capture
|
||||
|> literal ".json"
|
||||
|> serverRender
|
||||
|> Internal.ApiRoute.toPattern
|
||||
|> Expect.equal
|
||||
|
@ -1,6 +1,6 @@
|
||||
module FormDataTest exposing (all)
|
||||
|
||||
import Dict exposing (Dict)
|
||||
import Dict
|
||||
import Expect
|
||||
import FormData
|
||||
import Test exposing (Test, describe, test)
|
||||
|
@ -5,7 +5,7 @@ import Dict
|
||||
import Expect
|
||||
import Form
|
||||
import Form.Value
|
||||
import Test exposing (Test, describe, only, skip, test)
|
||||
import Test exposing (Test, describe, skip, test)
|
||||
import Time
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ all =
|
||||
|> Form.withInitialValue (Date.fromCalendarDate 2022 Time.Jan 1 |> Form.Value.date)
|
||||
)
|
||||
|> Form.validate
|
||||
(\( checkin, checkout ) ->
|
||||
(\_ ->
|
||||
[ ( "checkin", [ "Must be before checkout date." ] )
|
||||
]
|
||||
)
|
||||
@ -237,7 +237,7 @@ all =
|
||||
|> Form.withInitialValue (Date.fromCalendarDate 2022 Time.Jan 1 |> Form.Value.date)
|
||||
)
|
||||
|> Form.validate
|
||||
(\( checkin, checkout ) ->
|
||||
(\_ ->
|
||||
[ ( "checkin", [ "Must be before checkout date." ] )
|
||||
]
|
||||
)
|
||||
@ -377,7 +377,7 @@ expectErrorsAfterUpdates expected form =
|
||||
|> List.map
|
||||
(\formModel () ->
|
||||
formModel.fields
|
||||
|> Dict.map (\key value -> value.errors)
|
||||
|> Dict.map (\_ value -> value.errors)
|
||||
|> Expect.equalDicts (Dict.fromList expected)
|
||||
)
|
||||
)
|
||||
@ -401,7 +401,7 @@ performUpdatesThenExpectErrors updatesToPerform expected form =
|
||||
|> List.map
|
||||
(\formModel () ->
|
||||
formModel.fields
|
||||
|> Dict.map (\key value -> value.errors)
|
||||
|> Dict.map (\_ value -> value.errors)
|
||||
|> Expect.equalDicts (Dict.fromList expected)
|
||||
)
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ import Json.Decode
|
||||
import Json.Encode
|
||||
import OptimizedDecoder
|
||||
import Server.Request as Request
|
||||
import Test exposing (Test, describe, only, test)
|
||||
import Test exposing (Test, describe, test)
|
||||
|
||||
|
||||
all : Test
|
||||
@ -87,13 +87,13 @@ all =
|
||||
\() ->
|
||||
Request.oneOf
|
||||
[ Request.expectFormPost
|
||||
(\{ field, optionalField } ->
|
||||
(\{ field } ->
|
||||
field "first"
|
||||
)
|
||||
, Request.expectJsonBody (OptimizedDecoder.field "first" OptimizedDecoder.string)
|
||||
, Request.expectQueryParam "first"
|
||||
, Request.expectMultiPartFormPost
|
||||
(\{ field, optionalField } ->
|
||||
(\{ field } ->
|
||||
field "first"
|
||||
)
|
||||
]
|
||||
@ -143,7 +143,7 @@ expectMatch request (Request.Request decoder) =
|
||||
of
|
||||
Ok ok ->
|
||||
case ok of
|
||||
( Ok inner, [] ) ->
|
||||
( Ok _, [] ) ->
|
||||
Expect.pass
|
||||
|
||||
( Err innerError, otherErrors ) ->
|
||||
@ -171,7 +171,7 @@ expectNoMatch request expectedErrorString (Request.Request decoder) =
|
||||
of
|
||||
Ok ok ->
|
||||
case ok of
|
||||
( Ok inner, [] ) ->
|
||||
( Ok _, [] ) ->
|
||||
Expect.fail "Expected this request not to match, but instead it did match."
|
||||
|
||||
( Err innerError, otherErrors ) ->
|
||||
|
@ -1,7 +1,7 @@
|
||||
module SetCookieTest exposing (all)
|
||||
|
||||
import Expect
|
||||
import Server.SetCookie as SetCookie exposing (..)
|
||||
import Server.SetCookie exposing (..)
|
||||
import Test exposing (Test, describe, test)
|
||||
import Time
|
||||
|
||||
@ -73,7 +73,7 @@ all =
|
||||
\() ->
|
||||
setCookie "id" "a3fWa"
|
||||
|> nonSecure
|
||||
|> withSameSite SetCookie.Strict
|
||||
|> withSameSite Strict
|
||||
|> toString
|
||||
|> Expect.equal "id=a3fWa; SameSite=Strict"
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user