Phoenix.LiveViewTest.form
You're seeing just the function
form
, go back to Phoenix.LiveViewTest module for more information.
Returns a form element to scope a function to.
It expects the current LiveView, a query selector, and the form data. The query selector must return a single element.
The form data will be validated directly against the form markup and make sure the data you are changing/submitting actually exists, failing otherwise.
Examples
assert view
|> form("#term", user: %{name: "hello"})
|> render_submit() =~ "Name updated"
This function is meant to mimic what the user can actually do, so you cannot
set hidden input values. However, hidden values can be given when calling
render_submit/2
or render_change/2
, see their docs for examples.