Phoenix.LiveViewTest.render_keydown
You're seeing just the function
render_keydown
, go back to Phoenix.LiveViewTest module for more information.
Sends a keydown event given by element
and returns the rendered result.
The element
is created with element/3
and must point to a single element
on the page with a phx-keydown
or phx-window-keydown
attribute in it.
The event name given set on phx-keydown
is then sent to the appropriate
LiveView (or component if phx-target
is set accordingly). All phx-value-*
entries in the element are sent as values. Extra values can be given with
the value
argument.
It returns the contents of the whole LiveView or an {:error, redirect}
tuple.
Examples
{:ok, view, html} = live(conn, "/thermo")
assert html =~ "The temp is: 30℉"
assert view |> element("#inc") |> render_keydown() =~ "The temp is: 31℉"
Sends a keydown event to the view and returns the rendered result.
It returns the contents of the whole LiveView or an {:error, redirect}
tuple.
Examples
{:ok, view, html} = live(conn, "/thermo")
assert html =~ "The temp is: 30℉"
assert render_keydown(view, :inc) =~ "The temp is: 31℉"