fix: 允许已采集 PDD 商品重新采集 (#121)
This commit is contained in:
@@ -65,6 +65,25 @@ func TestPurchaseModal_未选规格行保持隐藏且不提交(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPddDetailRecollect_使用独立入口并可选客户端(t *testing.T) {
|
||||
content, err := os.ReadFile("templates/pdd/edit_modal.html")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
page := string(content)
|
||||
for _, want := range []string{
|
||||
`action="/pdd/recollect"`, `name="goods_id"`, `name="client_id"`,
|
||||
"不指定(任意客户端可领取)", "成功后再用新结果覆盖",
|
||||
} {
|
||||
if !strings.Contains(page, want) {
|
||||
t.Errorf("PDD 详情重新采集缺少 %q", want)
|
||||
}
|
||||
}
|
||||
if strings.Contains(page, `id="pdd-recollect-form" method="post" action="/pdd/collect"`) {
|
||||
t.Error("重新采集不能继续复用会跳过已采集商品的普通批量入口")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTemplatesAndRoutesCanBeBuiltWithoutDatabaseConnection(t *testing.T) {
|
||||
if _, err := newRouter(nil); err != nil {
|
||||
t.Fatalf("模板或路由组装失败: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user