stackchain-dashboard/tests/test_unfiled_draft_integration.py
timmy 3dd0ba2024
All checks were successful
CI / lint (pull_request) Successful in 1m52s
CI / build-release (pull_request) Successful in 5s
CI / release-candidate (pull_request) Has been skipped
feat: sync unfiled drafts across devices (Closes #851)
2026-08-14 21:39:22 +00:00

22 lines
910 B
Python

from pathlib import Path
from src.frontend_bundle import FEATURE_SOURCES, build_frontend
ROOT = Path(__file__).parents[1]
def test_cross_device_unfiled_draft_sync_is_shipped_and_wired_to_user_flow():
html = (ROOT / "frontend" / "index.html").read_text()
dashboard = (ROOT / "frontend" / "dashboard.js").read_text()
assert '<script src="static/unfiled-draft-sync.js"></script>' in html
assert "static/unfiled-draft-sync.js" in FEATURE_SOURCES["today-timer"]
assert "createUnfiledDraftSync(" in dashboard
assert "unfiledCaptures, fetchReviewJson" in dashboard
assert "Saved on this device · sync pending" in (ROOT / "frontend" / "unfiled-draft-sync.js").read_text()
built = build_frontend(ROOT / "frontend")
assert "unfiled-draft-sync.js" not in built.dashboard_html
assert b"stackchain.unfiled-draft-sync.v1" in built.feature_bundles["today-timer"].runtime_bytes