mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-09-19 11:03:52 +00:00
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
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user