[claude] Add /help page for Nexus web frontend (#833) (#887)
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
This commit was merged in pull request #887.
This commit is contained in:
42
tests/test_help_page.py
Normal file
42
tests/test_help_page.py
Normal file
@@ -0,0 +1,42 @@
|
||||
"""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 "<!DOCTYPE html>" in content
|
||||
assert "<html" in content
|
||||
assert "</html>" 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 <kbd> elements
|
||||
for key in ["<kbd>W</kbd>", "<kbd>A</kbd>", "<kbd>S</kbd>", "<kbd>D</kbd>",
|
||||
"Mouse", "Enter", "Esc"]:
|
||||
assert key in content, f"help page must document the {key!r} control"
|
||||
Reference in New Issue
Block a user