"""Tests for the /help page. Refs: #833 (Missing /help page).""" from pathlib import Path def test_help_html_exists() -> None: assert Path("help.html").exists(), "help.html must exist to resolve /help 404" def test_help_html_is_valid_html() -> None: content = Path("help.html").read_text() assert "" in content assert "" in content def test_help_page_has_required_sections() -> None: content = Path("help.html").read_text() # Navigation controls section assert "Navigation Controls" in content # Chat commands section assert "Chat" in content # Portal reference assert "Portal" in content # Back link to home assert 'href="/"' in content def test_help_page_links_back_to_home() -> None: content = Path("help.html").read_text() assert 'href="/"' in content, "help page must have a link back to the main Nexus world" def test_help_page_has_keyboard_controls() -> None: content = Path("help.html").read_text() # Movement keys are listed individually as elements for key in ["W", "A", "S", "D", "Mouse", "Enter", "Esc"]: assert key in content, f"help page must document the {key!r} control"