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
Browsers you attempted to reproduce this bug on (the more the merrier): n/a
Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes
Actual behavior
if i have a form submit event handler that does a push_patch in a parent liveview, when submitting the form in a test like this:
test "can assert on update from parent syncronously", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p|/|)
view
|> element("#parent-form")
|> render_submit()
end
the handle_params function is called and completes before the test exits
however, if i have the same event handler in a child component and initiate the push_patch from the child, the same test (with the form in the component rather than the parent) exits before the handle_params function returns
test "cannot assert on update from child syncronously", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p|/|)
view
|> element("#child-form")
|> render_submit()
end
in my case, i have db queries in handle_params and end up with db errors:
You can await the navigation with an assert_patch call. In the context of a LC, it sends a message to the parent to navigate, so you need to await this event being sent. Thanks!
Environment
Actual behavior
if i have a form submit event handler that does a push_patch in a parent liveview, when submitting the form in a test like this:
the handle_params function is called and completes before the test exits
however, if i have the same event handler in a child component and initiate the push_patch from the child, the same test (with the form in the component rather than the parent) exits before the handle_params function returns
in my case, i have db queries in handle_params and end up with db errors:
after the test ends
Expected behavior
render_submit should behave the same in both instances?
The text was updated successfully, but these errors were encountered: