fix: 增加 AI 匹配失败弹窗并补齐部署配置 (#229)

This commit is contained in:
chengma
2026-08-14 17:48:58 +08:00
parent 03d3cb5ac9
commit 0208dc6b76
11 changed files with 105 additions and 6 deletions
+25
View File
@@ -87,6 +87,31 @@ func TestSybRedirectAfterStart_清除本次日期范围(t *testing.T) {
}
}
func TestSybRedirectAIMatchError_独立错误参数并保留列表状态(t *testing.T) {
context, recorder := sybPostContext(t, url.Values{
"order_no": {"ORDER-1"}, "shop": {"店铺A"}, "stage": {"mapping_pending"},
"page": {"2"}, "date_from": {"2026-08-13"}, "date_to": {"2026-08-14"},
})
(&Handler{}).sybRedirectAIMatchError(context, "AI 规格匹配未开始:密钥存储不可用")
location, err := url.Parse(recorder.Header().Get("Location"))
if err != nil {
t.Fatal(err)
}
query := location.Query()
for name, want := range map[string]string{
"order_no": "ORDER-1", "shop": "店铺A", "stage": "mapping_pending", "page": "2",
"date_from": "2026-08-13", "date_to": "2026-08-14",
"ai_error": "AI 规格匹配未开始:密钥存储不可用",
} {
if got := query.Get(name); got != want {
t.Errorf("AI 错误跳转丢失 %s:got=%q want=%q Location=%s", name, got, want, location.String())
}
}
if query.Has("msg") {
t.Fatalf("AI 错误不能混入普通状态消息:%s", location.String())
}
}
func TestSybHistoryPagination_保留筛选并重开弹窗(t *testing.T) {
view := sybHistoryPagination(2, 3, "ORDER-1", "店铺A", "pdd_missing", "2026-08-01", "2026-08-09")
for _, raw := range []string{view.FirstURL, view.PrevURL, view.NextURL, view.LastURL} {