Migrate use of old Form type.

This commit is contained in:
Dillon Kearns 2022-07-23 20:29:03 +02:00
parent f77db01796
commit 320374cee7

View File

@ -62,21 +62,27 @@ all =
[ ( "q", "hello" ) ]
, test "tries multiple form post formats" <|
\() ->
Request.formDataWithoutServerValidation
[ Form.init
Request.formDataWithoutServerValidation2
[ Form.init2
(\bar ->
Validation.succeed identity
|> Validation.andMap bar
{ combine =
Validation.succeed identity
|> Validation.andMap bar
, view =
\_ -> ()
}
)
(\_ _ -> ())
|> Form.field "bar" Field.text
, Form.init
|> Form.field2 "bar" Field.text
, Form.init2
(\bar ->
Validation.succeed identity
|> Validation.andMap bar
{ combine =
Validation.succeed identity
|> Validation.andMap bar
, view =
\_ -> ()
}
)
(\_ _ -> ())
|> Form.field "foo" Field.text
|> Form.field2 "foo" Field.text
]
|> expectMatch
{ method = Request.Post
@ -92,14 +98,17 @@ all =
}
, test "expectFormPost with missing content-type" <|
\() ->
Request.formDataWithoutServerValidation
[ Form.init
Request.formDataWithoutServerValidation2
[ Form.init2
(\bar ->
Validation.succeed identity
|> Validation.andMap bar
{ combine =
Validation.succeed identity
|> Validation.andMap bar
, view =
\_ -> ()
}
)
(\_ _ -> ())
|> Form.field "bar" Field.text
|> Form.field2 "bar" Field.text
]
|> expectNoMatch
{ method = Request.Post