feat(frontend): 新增廠商缺貨 V2 feature flag

This commit is contained in:
OoO
2026-05-01 00:06:46 +08:00
parent 6c73c57a91
commit c9247f7a79
7 changed files with 276 additions and 11 deletions

View File

@@ -63,3 +63,18 @@ def test_edm_dashboard_v2_is_feature_flagged_and_uses_real_campaign_data():
assert "scheduler_stats.get(task_key, [])" in template
assert "mock" not in template.lower()
assert "假商品" not in template
def test_vendor_stockout_v2_is_feature_flagged_and_uses_real_vendor_data():
route_source = (ROOT / "routes/vendor_routes.py").read_text(encoding="utf-8")
template = (ROOT / "web/templates/vendor_stockout_index_v2.html").read_text(encoding="utf-8")
assert "request.args.get('ui') == 'v2'" in route_source
assert "vendor_stockout_index_v2.html" in route_source
assert "_get_vendor_dashboard_stats()" in route_source
assert "session.query(VendorStockout).count()" in route_source
assert "EmailSendLog" in route_source
assert "stats.get('pending_stockouts'" in template
assert "stats.get('email_success_rate'" in template
assert "mock" not in template.lower()
assert "" not in template