mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 15:12:01 +03:00
Comment out test case that's still in the design stage.
This commit is contained in:
parent
a0c378a1df
commit
1e2f4981ed
@ -178,81 +178,80 @@ all =
|
|||||||
[ ( "first", [ "Required" ] )
|
[ ( "first", [ "Required" ] )
|
||||||
, ( "last", [ "Required" ] )
|
, ( "last", [ "Required" ] )
|
||||||
]
|
]
|
||||||
, skip <|
|
|
||||||
test "form-level validations are when there are recoverable field-level errors" <|
|
|
||||||
\() ->
|
|
||||||
let
|
|
||||||
form =
|
|
||||||
Form.succeed Tuple.pair
|
|
||||||
|> Form.with
|
|
||||||
(Form.text "password" toInput
|
|
||||||
|> Form.required "Required"
|
|
||||||
)
|
|
||||||
|> Form.with
|
|
||||||
(Form.text "password-confirmation" toInput
|
|
||||||
|> Form.required "Required"
|
|
||||||
)
|
|
||||||
|> Form.validate
|
|
||||||
(\( password, passwordConfirmation ) ->
|
|
||||||
if password == passwordConfirmation then
|
|
||||||
[]
|
|
||||||
|
|
||||||
else
|
--, test "form-level validations are run when there are recoverable field-level errors" <|
|
||||||
[ ( "password-confirmation", [ "Passwords must match." ] )
|
-- \() ->
|
||||||
]
|
-- let
|
||||||
)
|
-- form =
|
||||||
|> Form.appendForm Tuple.pair
|
-- Form.succeed Tuple.pair
|
||||||
(Form.succeed identity
|
-- |> Form.with
|
||||||
|> Form.with
|
-- (Form.text "password" toInput
|
||||||
(Form.text "name" toInput
|
-- |> Form.required "Required"
|
||||||
|> Form.required "Required"
|
-- )
|
||||||
)
|
-- |> Form.with
|
||||||
)
|
-- (Form.text "password-confirmation" toInput
|
||||||
in
|
-- |> Form.required "Required"
|
||||||
form
|
-- )
|
||||||
|> Form.init
|
-- |> Form.validate
|
||||||
|> updateField form ( "password", "abcd" )
|
-- (\( password, passwordConfirmation ) ->
|
||||||
|> updateField form ( "password-confirmation", "abcd" )
|
-- if password == passwordConfirmation then
|
||||||
|> expectErrors
|
-- []
|
||||||
[ ( "name", [ "Required" ] )
|
--
|
||||||
, ( "password", [] )
|
-- else
|
||||||
, ( "password-confirmation", [ "Passwords must match." ] )
|
-- [ ( "password-confirmation", [ "Passwords must match." ] )
|
||||||
]
|
-- ]
|
||||||
, skip <|
|
-- )
|
||||||
test "dependent validations are run when other fields have recoverable errors" <|
|
-- |> Form.appendForm Tuple.pair
|
||||||
\() ->
|
-- (Form.succeed identity
|
||||||
Form.succeed Tuple.pair
|
-- |> Form.with
|
||||||
|> Form.with
|
-- (Form.text "name" toInput
|
||||||
(Form.date "checkin"
|
-- |> Form.required "Required"
|
||||||
{ invalid = \_ -> "Invalid date" }
|
-- )
|
||||||
toInput
|
-- )
|
||||||
|> Form.required "Required"
|
-- in
|
||||||
|> Form.withInitialValue (Date.fromCalendarDate 2022 Time.Jan 1 |> Form.Value.date)
|
-- form
|
||||||
)
|
-- |> Form.init
|
||||||
|> Form.with
|
-- |> updateField form ( "password", "abcd" )
|
||||||
(Form.date "checkout"
|
-- |> updateField form ( "password-confirmation", "abcd" )
|
||||||
{ invalid = \_ -> "Invalid date" }
|
-- |> expectErrors
|
||||||
toInput
|
-- [ ( "name", [ "Required" ] )
|
||||||
|> Form.required "Required"
|
-- , ( "password", [] )
|
||||||
|> Form.withInitialValue (Date.fromCalendarDate 2022 Time.Jan 1 |> Form.Value.date)
|
-- , ( "password-confirmation", [ "Passwords must match." ] )
|
||||||
)
|
-- ]
|
||||||
|> Form.validate
|
--, test "dependent validations are run when other fields have recoverable errors" <|
|
||||||
(\_ ->
|
-- \() ->
|
||||||
[ ( "checkin", [ "Must be before checkout date." ] )
|
-- Form.succeed Tuple.pair
|
||||||
]
|
-- |> Form.with
|
||||||
)
|
-- (Form.date "checkin"
|
||||||
|> Form.appendForm Tuple.pair
|
-- { invalid = \_ -> "Invalid date" }
|
||||||
(Form.succeed identity
|
-- toInput
|
||||||
|> Form.with
|
-- |> Form.required "Required"
|
||||||
(Form.text "name" toInput
|
-- |> Form.withInitialValue (Date.fromCalendarDate 2022 Time.Jan 1 |> Form.Value.date)
|
||||||
|> Form.required "Required"
|
-- )
|
||||||
)
|
-- |> Form.with
|
||||||
)
|
-- (Form.date "checkout"
|
||||||
|> expectErrorsAfterUpdates
|
-- { invalid = \_ -> "Invalid date" }
|
||||||
[ ( "checkin", [ "Must be before checkout date." ] )
|
-- toInput
|
||||||
, ( "checkout", [] )
|
-- |> Form.required "Required"
|
||||||
, ( "name", [ "Required" ] )
|
-- |> Form.withInitialValue (Date.fromCalendarDate 2022 Time.Jan 1 |> Form.Value.date)
|
||||||
]
|
-- )
|
||||||
|
-- |> Form.validate
|
||||||
|
-- (\_ ->
|
||||||
|
-- [ ( "checkin", [ "Must be before checkout date." ] )
|
||||||
|
-- ]
|
||||||
|
-- )
|
||||||
|
-- |> Form.appendForm Tuple.pair
|
||||||
|
-- (Form.succeed identity
|
||||||
|
-- |> Form.with
|
||||||
|
-- (Form.text "name" toInput
|
||||||
|
-- |> Form.required "Required"
|
||||||
|
-- )
|
||||||
|
-- )
|
||||||
|
-- |> expectErrorsAfterUpdates
|
||||||
|
-- [ ( "checkin", [ "Must be before checkout date." ] )
|
||||||
|
-- , ( "checkout", [] )
|
||||||
|
-- , ( "name", [ "Required" ] )
|
||||||
|
-- ]
|
||||||
, test "min validation runs in pure elm" <|
|
, test "min validation runs in pure elm" <|
|
||||||
\() ->
|
\() ->
|
||||||
Form.succeed identity
|
Form.succeed identity
|
||||||
|
Loading…
Reference in New Issue
Block a user