Created
February 8, 2021 22:10
-
-
Save mcrumm/751f34c6a54df754c3f54cd747c42780 to your computer and use it in GitHub Desktop.
LiveView artifacts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyAppWeb.PageLiveTest do | |
use MyAppWeb.ConnCase | |
import Phoenix.LiveViewTest | |
@tag :tmp_dir | |
test "disconnected and connected render", %{conn: conn, tmp_dir: tmp_dir} do | |
{:ok, page_live, disconnected_html} = live(conn, "/") | |
assert disconnected_html =~ "Welcome to Phoenix!" | |
assert page_live | |
|> open_browser(&File.copy!(&1, Path.join([tmp_dir, "welcome.html"]))) | |
|> render() =~ "Welcome to Phoenix!" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment