feat: 档口入库码支持软删除与重导恢复 (#238)
This commit is contained in:
@@ -29,16 +29,20 @@ func TestInnerCodeTemplate_独立导航与安全表单(t *testing.T) {
|
||||
page := string(raw)
|
||||
for _, want := range []string{
|
||||
`action="/inner-codes/import"`, `action="/inner-codes/match"`,
|
||||
`action="/inner-codes/apply"`, `action="/inner-codes/recheck"`,
|
||||
`action="/inner-codes/apply"`, `action="/inner-codes/recheck"`, `action="/inner-codes/delete"`,
|
||||
`name="csrf_token"`, `data-check-all`, `data-inner-code-apply-open`,
|
||||
`data-need-checked="inner-code-match"`, `data-inner-code-id="{{.ID}}"`,
|
||||
`inner-code-match{{end}}{{if .CanApply}} inner-code-apply`,
|
||||
`{{if not .CanMatch}}disabled{{end}}`, `匹配已选`, `aria-label="档口入库码记录列表"`,
|
||||
`data-need-checked="inner-code-delete"`, `data-confirm-delete-action="inner-code-delete"`,
|
||||
`inner-code-delete {{if .CanMatch}}inner-code-match{{end}}{{if .CanApply}} inner-code-apply`,
|
||||
`删除不会撤销顺运宝已写入的快递单号`, `匹配已选`, `aria-label="档口入库码记录列表"`,
|
||||
} {
|
||||
if !strings.Contains(page, want) {
|
||||
t.Errorf("正式页面缺少 %s", want)
|
||||
}
|
||||
}
|
||||
if strings.Contains(page, `{{if not .CanMatch}}disabled{{end}}`) {
|
||||
t.Fatal("所有状态都应允许勾选删除,不能再按 CanMatch 禁用复选框")
|
||||
}
|
||||
}
|
||||
|
||||
func TestInnerCodeTemplate_模块状态白名单已登记(t *testing.T) {
|
||||
@@ -52,6 +56,8 @@ func TestInnerCodeTemplate_模块状态白名单已登记(t *testing.T) {
|
||||
for _, want := range []string{
|
||||
`appendSelectedIDs(matchForm, "inner-code-match")`,
|
||||
`appendSelectedIDs(applyForm, "inner-code-apply")`,
|
||||
`appendSelectedIDs(deleteForm, "inner-code-delete")`,
|
||||
`checkedCount(action)`,
|
||||
`field.name = "ids"`,
|
||||
} {
|
||||
if !strings.Contains(string(raw), want) {
|
||||
|
||||
Reference in New Issue
Block a user