base for liveview testing done
This commit is contained in:
parent
fa4ef7ddd0
commit
83325adf09
|
@ -0,0 +1,17 @@
|
||||||
|
defmodule PokemonCoutureWeb.ClothesTrackerLiveTest do
|
||||||
|
# import Plug.Conn
|
||||||
|
# use PokemonCoutureWeb.ConnCase
|
||||||
|
# import Phoenix.LiveViewTest
|
||||||
|
import PokemonCouture.AccountsFixtures
|
||||||
|
@endpoint PokemonCoutureWeb.Endpoint
|
||||||
|
|
||||||
|
test "on not login redirect", %{conn: conn} do
|
||||||
|
assert {:error, {:redirect, %{to: "/users/log_in"}}} = live(conn, "/tracker")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "logged in user sees page", %{conn: conn} do
|
||||||
|
conn = conn |> log_in_user(user_fixture())
|
||||||
|
{:ok, view, html} = live(conn, "/tracker")
|
||||||
|
assert html =~ "Listing Clothes"
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,7 @@
|
||||||
|
defmodule PokemonCoutureWeb.ClothesComponentTest do
|
||||||
|
import Plug.Conn
|
||||||
|
import Phoenix.ConnTest
|
||||||
|
import Phoenix.LiveViewTest
|
||||||
|
import PokemonCouture.AccountsFixtures
|
||||||
|
@endpoint PokemonCoutureWeb.Endpoint
|
||||||
|
end
|
Loading…
Reference in New Issue