test_landing_validate.py file-level

at main · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:6 fix(ISR): default require_independent_second_reviewer to require Opera… · aaronrene · Sep 2, 2026
1 """Integration tests — landing validator on kit tree."""
2
3 from __future__ import annotations
4
5 import re
6 from pathlib import Path
7
8 from tools.landing.validate import validate_landing
9
10 KIT_ROOT = Path(__file__).resolve().parents[2]
11
12
13 def test_validate_landing_on_kit_root_passes() -> None:
14 result = validate_landing(KIT_ROOT)
15 assert result.ok, result.errors
16
17
18 def test_relative_doc_links_exist() -> None:
19 index = (KIT_ROOT / "docs" / "landing" / "index.html").read_text(encoding="utf-8")
20 # Docs open as GitHub-rendered pages — not raw relative .md (file:// / Pages).
21 assert "https://github.com/aaronrene/overseer-kit/blob/main/docs/GIT-ONLY-QUICKSTART.md" in index
22 assert "https://github.com/aaronrene/overseer-kit/blob/main/docs/CONSUMER-ADAPTER-PATTERN.md" in index
23 assert "https://github.com/aaronrene/overseer-kit/blob/main/docs/TRACK-Q-DESKTOP-OPERATOR-RUNBOOK.md" in index
24 assert "K7-DOGFOOD-OPERATOR-RUNBOOK" not in index
25 assert (KIT_ROOT / "docs" / "GIT-ONLY-QUICKSTART.md").is_file()
26 assert (KIT_ROOT / "docs" / "CONSUMER-ADAPTER-PATTERN.md").is_file()
27 assert (KIT_ROOT / "docs" / "TRACK-Q-DESKTOP-OPERATOR-RUNBOOK.md").is_file()
28
29
30 def test_scenarios_share_main_nav_shape() -> None:
31 scenarios = (KIT_ROOT / "docs" / "landing" / "scenarios" / "index.html").read_text(
32 encoding="utf-8"
33 )
34 assert 'href="../index.html"' in scenarios
35 assert 'href="../index.html#structure"' in scenarios
36 assert 'href="../index.html#console-access"' in scenarios
37 assert 'href="index.html"' in scenarios or 'href="./index.html"' in scenarios
38 assert 'aria-current="page"' in scenarios
39 assert "../index.html#scenarios" not in scenarios
40 assert 'href="../docs.html">Docs</a>' in scenarios
41 assert "https://github.com/aaronrene/overseer-kit#readme" not in scenarios
42 assert 'id="theme-toggle"' in scenarios
43 assert ">Landing<" not in scenarios # no alternate "Landing" chrome swap
44 assert scenarios.count("flow-diagram") == 5
45 assert "flow-linear" in scenarios
46 assert "flow-converge" in scenarios
47 assert "flow-loop" in scenarios
48 assert "flow-dual" in scenarios
49 assert "flow-handoff" in scenarios
50 assert "fail = no advance" not in scenarios
51 assert "Software engineering" in scenarios
52 assert scenarios.index("Software engineering") < scenarios.index("Video studio")
53 assert "gallery-intro" in scenarios
54
55
56 def test_main_nav_scenarios_goes_to_gallery() -> None:
57 index = (KIT_ROOT / "docs" / "landing" / "index.html").read_text(encoding="utf-8")
58 assert 'href="scenarios/index.html">Scenarios</a>' in index
59 # Nav must not use the mid-page teaser anchor as the Scenarios destination.
60 assert re.search(r'nav-links[\s\S]*?href="#scenarios">Scenarios', index) is None
61 assert 'src="assets/diagrams/honesty-loop.svg"' in index
62 assert (KIT_ROOT / "docs" / "landing" / "assets" / "diagrams" / "honesty-loop.svg").is_file()
63 assert 'src="assets/diagrams/mechanical-check.svg"' in index
64 assert (
65 KIT_ROOT / "docs" / "landing" / "assets" / "diagrams" / "mechanical-check.svg"
66 ).is_file()
67 assert "ok check-ok" in index
68 assert "hero-terminal" in index