You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to test the behavior of this form, so I wrote up the following using form/3 in a test:
assertlv|>form("#my-form",%{"form"=>%{"name"=>"asdf"}})|>render_change()=~"can't be blank"
Unfortunately, running this test gives me the following error:
1) test my test (MyAppWeb.FooTest)
test/my_app_web/live/foo_live_test.exs:148
** (ArgumentError) could not find non-disabled input, select or textarea with name "form[name]" within:
code: |> render_change() =~ "can't be blank"
stacktrace:
(phoenix_live_view 0.20.9) lib/phoenix_live_view/test/live_view_test.ex:1102: Phoenix.LiveViewTest.call/2
test/my_app_web/live/foo_live_test.exs:184: (test)
Expected behavior
form/3 let's me set values on inputs not directly nested within the form element.
The text was updated successfully, but these errors were encountered:
A pull request is welcome. If we can't find a name under the form, perhaps we should fallback to checking if the form has an ID and, if so, lookup for an element with matching name (and ID).
Environment
Actual behavior
I have a form with an input outside, looking something like this:
I want to test the behavior of this form, so I wrote up the following using
form/3
in a test:Unfortunately, running this test gives me the following error:
Expected behavior
form/3
let's me set values on inputs not directly nested within the form element.The text was updated successfully, but these errors were encountered: