Phoenix.LiveViewTest.render_focus
You're seeing just the function
render_focus
, go back to Phoenix.LiveViewTest module for more information.
Sends a focus 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-focus
attribute in it. The event name
given set on phx-focus
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 view
|> element("#inactive")
|> render_focus() =~ "Tap to wake"
Sends a focus 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_focus(view, :inactive) =~ "Tap to wake"