新增 PChome 覆核匯出與診斷原因
All checks were successful
CD Pipeline / deploy (push) Successful in 1m3s

This commit is contained in:
OoO
2026-05-20 09:48:25 +08:00
parent ac93d185f4
commit 0242aebb66
8 changed files with 237 additions and 4 deletions

View File

@@ -192,6 +192,27 @@ def test_ai_pick_export_uses_real_recommendation_data():
assert "pd.ExcelWriter" in export_source
def test_pchome_review_export_and_diagnostics_use_real_queue_data():
export_source = (ROOT / "routes/export_routes.py").read_text(encoding="utf-8")
repository_source = (ROOT / "services/competitor_intel_repository.py").read_text(encoding="utf-8")
dashboard = (ROOT / "templates/dashboard_v2.html").read_text(encoding="utf-8")
dashboard_css = (ROOT / "web/static/css/page-dashboard-v2.css").read_text(encoding="utf-8")
assert "@export_bp.route('/api/export/excel/pchome-review')" in export_source
assert "fetch_competitor_review_queue_page" in export_source
assert "診斷原因" in export_source
assert "原始診斷" in export_source
assert "PChome比價覆核_" in export_source
assert "MATCH_DIAGNOSTIC_REASON_LABELS" in repository_source
assert "diagnostic_reasons" in repository_source
assert "商品線不符" in repository_source
assert "容量差異" in repository_source
assert "匯出覆核" in dashboard
assert "review.diagnostic_reasons" in dashboard
assert "dashboard-review-reasons" in dashboard
assert ".dashboard-review-reasons" in dashboard_css
def test_ai_intelligence_uses_v2_shell_and_real_runtime_apis():
template = (ROOT / "templates/ai_intelligence.html").read_text(encoding="utf-8")
route_source = (ROOT / "routes/ai_routes.py").read_text(encoding="utf-8")
@@ -355,6 +376,7 @@ def test_dashboard_v2_shows_pchome_competitor_pricing_and_links():
assert "_load_pchome_match_attempt_map" in route_source
assert "低信心待審" in route_source
assert "規格衝突待審" in route_source
assert "dashboard-review-reasons" in dashboard
assert "series.pchome" in page_js
assert "label: 'PChome'" in page_js
assert "含 PChome 歷史快照" in page_js