feat: 支持顺运宝批量创建采集任务 (#153)
This commit is contained in:
@@ -65,6 +65,37 @@ func TestPurchaseModal_未选规格行保持隐藏且不提交(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSybBulkActions_按服务端动作能力隔离勾选项(t *testing.T) {
|
||||
files := map[string][]string{
|
||||
"templates/syb/list.html": {
|
||||
`data-need-checked="collect"`, `data-need-checked="purchase"`,
|
||||
`data-select-action="{{if .CanCollect}}collect{{else if .CanPurchase}}purchase{{end}}"`,
|
||||
`{{if .CanCollect}}form="syb-collect-form"{{end}}`,
|
||||
`action="/syb/collect-pdd-batch"`, `id="syb-collect-modal"`,
|
||||
},
|
||||
"static/js/app.js": {
|
||||
`supportsSelectAction(box, action)`,
|
||||
`checkedCount(action)`,
|
||||
`supportsSelectAction(box, "purchase")`,
|
||||
`getAttribute("data-collect-action")`,
|
||||
},
|
||||
"handler/web/web.go": {
|
||||
`pages.POST("/syb/collect-pdd-batch", h.SybCollectPddBatch)`,
|
||||
},
|
||||
}
|
||||
for path, wants := range files {
|
||||
content, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, want := range wants {
|
||||
if !strings.Contains(string(content), want) {
|
||||
t.Errorf("%s 缺少动作隔离约束 %q", path, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPddDetailRecollect_使用独立入口并可选客户端(t *testing.T) {
|
||||
content, err := os.ReadFile("templates/pdd/edit_modal.html")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user