stackchain-dashboard/tests/test_today_session_handoff_ui.py
timmy 548b95ddb6
All checks were successful
CI / lint (pull_request) Successful in 3m48s
CI / build-release (pull_request) Successful in 8s
CI / browser-journey (pull_request) Successful in 5m42s
CI / release-candidate (pull_request) Has been skipped
feat: preserve Today timing ledger across handoff (Closes #1276)
2026-08-22 19:38:30 +00:00

28 lines
1.1 KiB
Python

from pathlib import Path
from src.frontend_bundle import build_frontend
ROOT = Path(__file__).parents[1]
def test_dashboard_packages_a_mobile_today_session_handoff():
build = build_frontend(ROOT / "frontend")
html = build.dashboard_html
dashboard = (ROOT / "frontend" / "dashboard.js").read_text()
css = (ROOT / "frontend" / "dashboard.css").read_text()
today_bundle = build.feature_bundles["today-timer"].runtime_bytes.decode()
assert 'id="today-session-handoff"' in html
assert 'id="continue-today-session"' in html
assert 'id="today-session-sync-status"' in html
assert 'aria-live="polite"' in html
assert "createTodaySessionSync" in today_bundle
assert "attachTodaySessionHandoff" in today_bundle
assert "Session syncing…" in today_bundle
assert "Session offline · will retry." in today_bundle
assert "Session continued on another device." in today_bundle
assert "todaySessionSync = attachTodaySessionHandoff" in dashboard
assert "todaySessionSync?.publish(timer.sessionSnapshot())" in dashboard
assert "min-height:44px" in css