Add first home live test
All checks were successful
builds.sr.ht Job completed

This commit is contained in:
2024-01-09 00:03:00 +00:00
parent fd655391e0
commit 0a308ea429

View File

@@ -0,0 +1,26 @@
defmodule WishWeb.HomeLiveTest do
use WishWeb.ConnCase
import Phoenix.LiveViewTest
import Wish.WishlistFixtures
import Wish.AccountsFixtures
defp create_item(_) do
item = item_fixture()
%{item: item}
end
describe "Index" do
setup [:create_item]
test "lists all items", %{conn: conn, item: item} do
{:ok, _index_live, html} =
conn
|> log_in_user(user_fixture())
|> live(~p"/")
assert html =~ "Daniel's Wishlist"
assert html =~ item.description
end
end
end