mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
* commented out lesson and learning strip until lessons are established * reword the hero section * change layout and working on puzzle section - remove top div as it was redundant * amend flash message on replay * switch cancel session for return home * remove system theme toggle since this is the default, leaving only light and dark toggles * add keyboard and screen reader support for play (#72) First draft covering the accessibility work in #72:\n\n- labelled SAN/UCI move input, validated against the tablebase and applied\n by the board hook, plus an accessible promotion picker\n- live-region announcements for moves, checks, checkmates and solve/fail,\n and a hidden text summary of the position\n- accessible labels, focus ring, skip link, keyboard-friendly review table\n and non-colour grade cues\n- WCAG AA text contrast roles and a responsive play surface\n- regression tests for move entry, announcements and link-style CTAs
This commit is contained in:
@@ -31,14 +31,13 @@ defmodule ChesstrainerWeb.LayoutsTest do
|
||||
end
|
||||
|
||||
describe "colour_mode_toggle/1" do
|
||||
test "renders all three modes as a labelled radiogroup" do
|
||||
test "renders light and dark modes as a labelled radiogroup" do
|
||||
html = render_component(&Layouts.colour_mode_toggle/1, %{})
|
||||
|
||||
assert html =~ ~s(role="radiogroup")
|
||||
assert html =~ ~s(aria-label="Colour mode")
|
||||
|
||||
for {mode, label} <- [
|
||||
{"system", "System colour mode"},
|
||||
{"light", "Light colour mode"},
|
||||
{"dark", "Dark colour mode"}
|
||||
] do
|
||||
@@ -47,6 +46,7 @@ defmodule ChesstrainerWeb.LayoutsTest do
|
||||
assert html =~ ~s(role="radio")
|
||||
end
|
||||
|
||||
refute html =~ ~s(data-phx-theme="system")
|
||||
assert html =~ ~s(aria-checked="true")
|
||||
end
|
||||
|
||||
@@ -57,4 +57,13 @@ defmodule ChesstrainerWeb.LayoutsTest do
|
||||
assert html =~ ~s(class="nav-right")
|
||||
end
|
||||
end
|
||||
|
||||
describe "pill button" do
|
||||
test "renders the navigation call to action as a link" do
|
||||
html = render_component(&Layouts.navbar/1, %{current_scope: nil})
|
||||
|
||||
assert html =~ ~r/<a[^>]*class="nav-cta"/
|
||||
refute html =~ ~r/<button[^>]*class="nav-cta"/
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user