Files
Jyotisha/tests/test_daily_and_rectification_entrypoints.py
T
jesse-ux e4e73f56c0
Independent Staging Quality Gate / publish (push) Canceled after 0s
Independent Staging Quality Gate / validate (push) Canceled after 9m33s
fix(web): 四个页面共用一份会话列表,空会话不入列
对话、星盘、星历、报告进同一 (app) 外壳,列表只拉一次。服务端不再列出空咨询;新建复用已有空会话。新标题改成「生时校正 · M月D日」,侧栏副标题用创建时间。
2026-09-17 21:27:40 +08:00

55 lines
2.1 KiB
Python

from pathlib import Path
PAGE = Path("frontend/src/app/(app)/page.tsx")
STARTER_HOME = Path("frontend/src/components/starter-home.tsx")
HOME_CLOUD = Path("frontend/src/lib/home-cloud-sync.ts")
RECTIFICATION_HOOK = Path("frontend/src/hooks/use-rectification-surface.ts")
DAILY_ROUTE = Path("frontend/src/app/api/daily-starlanguage/route.ts")
RECTIFICATION_ROUTE = Path("frontend/src/app/api/birth-rectification/route.ts")
def _home_entrypoint_surface() -> str:
parts = [PAGE, STARTER_HOME, HOME_CLOUD]
if RECTIFICATION_HOOK.exists():
parts.append(RECTIFICATION_HOOK)
return "".join(path.read_text(encoding="utf-8") for path in parts)
def test_daily_starlanguage_entrypoint_is_productized() -> None:
source = _home_entrypoint_surface()
assert "今日星语" in source
assert "fetchDailyStarlanguage" in source
assert "daily-starlanguage-card" in source
assert "startDailyStarlanguageConsultation" in source
assert "从今日问起" in source
assert "今天的星语还没写出来。" in source
assert "buildDailyStarlanguageCard" not in source
assert "点这里" not in source
assert "不会用通用文案顶替" not in source
def test_daily_starlanguage_api_declares_honest_source_boundary() -> None:
source = DAILY_ROUTE.read_text(encoding="utf-8")
assert "status: \"ok\"" in source
assert "/api/daily_guidance" in source
assert "/api/chart" not in source
assert "/api/transit" not in source
assert "exploratory_unvalidated" in source
assert "not_deterministic_prediction" in source
def test_birth_time_rectification_entrypoint_is_productized() -> None:
source = _home_entrypoint_surface()
assert "生时校正" in source
assert "birth-rectification-card" in source
assert "openRectificationFromHomepage" in source
def test_birth_rectification_api_proxies_active_questionnaire_with_boundary() -> None:
source = RECTIFICATION_ROUTE.read_text(encoding="utf-8")
assert "/api/active_rectification_questions" in source
assert "candidate_scan" in source
assert "question_count" in source
assert "not_auto_rectified" in source