cannery/test/cannery_web/live/home_live_test.exs

23 lines
651 B
Elixir
Raw Normal View History

2021-09-10 00:28:53 -04:00
defmodule CanneryWeb.HomeLiveTest do
2022-02-16 22:52:22 -05:00
@moduledoc """
Tests the home page
"""
2021-09-10 00:28:53 -04:00
use CanneryWeb.ConnCase
import Phoenix.LiveViewTest
2022-02-16 22:52:22 -05:00
@moduletag :home_live_test
2021-09-10 00:28:53 -04:00
test "disconnected and connected render", %{conn: conn} do
2023-04-14 23:34:11 -04:00
{:ok, home_live, disconnected_html} = live(conn, ~p"/")
2023-03-28 21:57:29 -04:00
assert disconnected_html =~ "Welcome to Cannery"
assert render(home_live) =~ "Welcome to Cannery"
2021-09-10 00:28:53 -04:00
end
2022-11-19 10:31:13 -05:00
test "displays version number", %{conn: conn} do
2023-04-14 23:34:11 -04:00
{:ok, home_live, disconnected_html} = live(conn, ~p"/")
2022-11-19 10:31:13 -05:00
assert disconnected_html =~ Mix.Project.config()[:version]
assert render(home_live) =~ Mix.Project.config()[:version]
end
2021-09-10 00:28:53 -04:00
end