收斂 PChome AI 第一視窗文案守門
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-02 14:04:18 +08:00
parent 06754e4a8c
commit c1cb994d61
6 changed files with 78 additions and 18 deletions

View File

@@ -403,7 +403,7 @@ def test_dashboard_v2_is_production_default_and_uses_real_dashboard_data():
assert "高業績商品作戰清單" in dashboard
assert "業績 × MOMO 價格 × 下一步" in dashboard
assert "growth.mapping_rate" in dashboard
assert "找同款 · 決策 · 證據 · 落地 · 回讀 · retention" in dashboard
assert "找同款 · 決策 · 證據 · 落地 · 回讀 · 留存" in dashboard
assert "growth.ai_automation_first_viewport" in dashboard
assert "ai_first_viewport.title" in dashboard
assert "ai_first_viewport.metric" in dashboard

View File

@@ -0,0 +1,47 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_pchome_dashboard_ai_first_viewport_uses_product_language():
route_source = (ROOT / "routes/dashboard_routes.py").read_text(encoding="utf-8")
dashboard = (ROOT / "templates/dashboard_v2.html").read_text(encoding="utf-8")
first_viewport = dashboard.split('<div class="growth-automation-panel"', 1)[1].split(
'<div class="growth-command-grid"',
1,
)[0]
assert "找同款 · 決策 · 證據 · 落地 · 回讀 · 留存" in first_viewport
assert "主流程阻斷 0 · 回讀待建立 · 證據留存待建立" in route_source
assert "· 異動 {controlled_apply_drift_count} · 留存" in route_source
assert "'label': '最新回讀'" in route_source
assert "'label': '證據留存'" in route_source
assert "資料寫入" in route_source
assert "清理建議" in route_source
forbidden_first_viewport_terms = [
"retention",
"Compact",
"Artifact",
"DB writes",
"prune",
"endpoint",
"commit",
"JSON",
"table",
]
for marker in forbidden_first_viewport_terms:
assert marker not in first_viewport
forbidden_visible_route_literals = [
"· drift ",
"· retention ",
"'Compact 回讀'",
"'Artifact retention'",
"DB writes",
"prune 候選",
"retention 待建立",
]
for marker in forbidden_visible_route_literals:
assert marker not in route_source