Phoenix.LiveViewTest.live_isolated
You're seeing just the macro
live_isolated
, go back to Phoenix.LiveViewTest module for more information.
Spawns a connected LiveView process mounted in isolation as the sole rendered element.
Useful for testing LiveViews that are not directly routable, such as those built as small components to be re-used in multiple parents. Testing routable LiveViews is still recommended whenever possible since features such as live navigation require routable LiveViews.
Options
:session
- the session to be given to the LiveView
All other options are forwarded to the LiveView for rendering. Refer to
Phoenix.LiveView.Helpers.live_render/3
for a list of supported render
options.
Examples
{:ok, view, html} =
live_isolated(conn, AppWeb.ClockLive, session: %{"tz" => "EST"})
Use put_connect_params/2
to put connect params for a call to
Phoenix.LiveView.get_connect_params/1
in Phoenix.LiveView.mount/3
:
{:ok, view, html} =
conn
|> put_connect_params(%{"param" => "value"})
|> live_isolated(AppWeb.ClockLive, session: %{"tz" => "EST"})