various fixes
This commit is contained in:
@@ -125,8 +125,9 @@ def test_nav_sources_ships_hidden_on_every_nav_page() -> None:
|
||||
def test_all_five_pages_share_the_header_control_order() -> None:
|
||||
"""Phase 34 task 03 (owner confirmation 2026-08-26): every page
|
||||
ships the IDENTICAL header control inventory in the IDENTICAL
|
||||
order — brand, nav [Chat, Sources, Tuning], #steering-toggle,
|
||||
#sync-btn, #new-chat-btn, Sign in, Sign out — inside the shared
|
||||
order — brand, nav [Chat, Sources, Tuning], #sync-btn, #new-chat-btn,
|
||||
Sign in, Sign out (the #steering-toggle was removed from the navbar
|
||||
at owner request, 2026-08-28) — inside the shared
|
||||
.header-inner row (the document viewer's row 1). Only the
|
||||
current-page is-active nav marker and the static ?next= fallback
|
||||
may differ per page (task 05's story E2E pins the rendered
|
||||
@@ -137,7 +138,6 @@ def test_all_five_pages_share_the_header_control_order() -> None:
|
||||
'href="/"',
|
||||
'id="nav-sources"',
|
||||
'id="nav-tuning"',
|
||||
'id="steering-toggle"',
|
||||
'id="sync-btn"',
|
||||
'id="new-chat-btn"',
|
||||
'id="sign-in-link"',
|
||||
@@ -288,16 +288,16 @@ def test_login_page_carries_the_full_header() -> None:
|
||||
"""Phase 34 task 03 (owner confirmation 2026-08-26): the noted
|
||||
boundary is reversed by owner decision — the login page finally
|
||||
carries the FULL shared header: the nav gains the #nav-tuning link
|
||||
(same ship-hidden markup as the other pages), plus the Tuning
|
||||
toggle, the admin-only Sync button, New chat, and the Sign in /
|
||||
Sign out pair (ship hidden — initSharedHeader reveals exactly one
|
||||
after whoami; the static ?next= fallback is the login page itself).
|
||||
(same ship-hidden markup as the other pages), plus the admin-only
|
||||
Sync button, New chat, and the Sign in / Sign out pair (ship hidden
|
||||
— initSharedHeader reveals exactly one after whoami; the static
|
||||
?next= fallback is the login page itself). The Tuning toggle is NOT
|
||||
among them — removed from the navbar at owner request (2026-08-28).
|
||||
No nav link is "current" on the auth page."""
|
||||
text = _text(LOGIN_HTML)
|
||||
for marker in (
|
||||
'id="nav-sources"',
|
||||
'id="nav-tuning"',
|
||||
'id="steering-toggle"',
|
||||
'id="sync-btn"',
|
||||
'id="new-chat-btn"',
|
||||
'id="sign-in-link"',
|
||||
@@ -410,12 +410,11 @@ def test_header_module_owns_the_steering_panel() -> None:
|
||||
"""header.js owns the steering panel behavior (moved from app.js in
|
||||
phase 34 task 01): the module-level null-safe element refs, the
|
||||
newest-first textContent render (XSS contract), the labeled
|
||||
per-note delete, the count badge, the announcer, and the toggle
|
||||
binding that runs at module import (like the sign-out binding)."""
|
||||
per-note delete, and the announcer — and NO toggle wiring anymore
|
||||
(the navbar #steering-toggle was removed at owner request,
|
||||
2026-08-28; note management lives on /tuning.html)."""
|
||||
js = _text(HEADER_JS)
|
||||
for selector in (
|
||||
"#steering-toggle",
|
||||
"#steering-count",
|
||||
"#steering-panel",
|
||||
"#steering-list",
|
||||
"#steering-empty",
|
||||
@@ -430,9 +429,8 @@ def test_header_module_owns_the_steering_panel() -> None:
|
||||
assert 'del.setAttribute("aria-label", `Delete tuning note: ${n.note}`)' in js
|
||||
assert "async function deleteSteeringNote" in js
|
||||
assert 'fetch(`/api/steering/${encodeURIComponent(id)}`, { method: "DELETE" })' in js
|
||||
assert "steeringToggle.addEventListener" in js, "the toggle binding is module-owned"
|
||||
assert 'setAttribute("aria-expanded"' in js
|
||||
assert "refreshSteering()" in js # re-open refreshes the list
|
||||
assert "refreshSteering()" in js # the admin boot refresh + the form's save
|
||||
assert "steeringToggle" not in js, "the navbar toggle is gone (2026-08-28)"
|
||||
|
||||
|
||||
def test_header_module_exports_refresh_and_announce_steering() -> None:
|
||||
@@ -455,17 +453,18 @@ def test_header_module_exports_refresh_and_announce_steering() -> None:
|
||||
|
||||
|
||||
def test_init_shared_header_gates_the_steering_surface() -> None:
|
||||
"""Inside initSharedHeader: admin → the list refreshes (count badge
|
||||
right before the panel is ever opened; only when the page ships the
|
||||
panel markup); anonymous → the toggle + panel are REMOVED from the
|
||||
DOM (phase-16 'absent, not hidden') and /api/steering is never
|
||||
fetched."""
|
||||
"""Inside initSharedHeader: admin → the list refreshes (the panel
|
||||
ships hidden and is only kept fresh; only when the page ships the
|
||||
panel markup); anonymous → the panel is REMOVED from the DOM
|
||||
(phase-16 'absent, not hidden') and /api/steering is never fetched.
|
||||
The navbar toggle was removed at owner request (2026-08-28) — no
|
||||
unhide / remove of a toggle may be left behind."""
|
||||
js = _text(HEADER_JS)
|
||||
fn = js.find("function initSharedHeader")
|
||||
assert fn != -1
|
||||
body = js[fn : js.find("\n}", fn)]
|
||||
assert "if (steeringPanel) refreshSteering();" in body
|
||||
assert "steeringToggle?.remove();" in body
|
||||
assert "steeringToggle" not in body
|
||||
assert "steeringPanel?.remove();" in body
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user