Files
owenrees 7717278561 Feature/endgame play (#1)
* create endgame play section

* add cache tests

* normalise FENs - trim and fuill move to 1 on addition

* remove svg on root and allow navbar to exist across all pages

* update nav items
2026-08-11 22:38:18 +02:00

29 lines
819 B
Elixir

defmodule ChesstrainerWeb.EndgameLive.PlayerIndexTest do
use ChesstrainerWeb.ConnCase
import Phoenix.LiveViewTest
import Chesstrainer.EndgamesFixtures
test "lists endgames with a play link per row", %{conn: conn} do
endgame = endgame_fixture()
other = endgame_fixture()
{:ok, _view, html} = live(conn, ~p"/endgames")
assert html =~ "Endgames"
assert html =~ endgame.key
assert html =~ other.key
assert html =~ ~p"/endgames/#{endgame}/play"
assert html =~ ~p"/endgames/#{other}/play"
end
test "navigating to a play page renders the board", %{conn: conn} do
endgame = endgame_fixture()
{:ok, view, _html} = live(conn, ~p"/endgames/#{endgame}/play")
assert has_element?(view, "#endgame-board")
assert has_element?(view, ~s{a[href="/endgames"]})
end
end