Closed krishandley closed 4 months ago
Hi there, thank you for the report. The functions in Phoenix.LiveViewTest
target a specific view. In order to send the submit event to the correct view, you'll need to explicitly target it using find_live_child/2
or live_children/1
:
assert child_view = find_live_child(view, "nested")
child_view
|> form("#nested_form", %{})
|> render_submit()
So I'd say it works as expected. If you think the documentation could be clearer, feel free to submit a PR :)
Environment
Descritpion
In tests with Phoenix.LiveViewTest, a nested LiveView form submit event goes to the parent LiveView but in real browsers the event is correctly sent to the nested LiveView.
An example repo can be found here https://github.com/krishandley/liveview_nested_form_test