feat: 按创建人隔离采集采购任务 (#127)
This commit is contained in:
@@ -100,6 +100,26 @@ func TestTaskDetail_采购核单结果使用独立只读分组(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskPage_创建人筛选列表列和详情字段齐全(t *testing.T) {
|
||||
files := map[string][]string{
|
||||
"templates/task/list.html": {
|
||||
`{{if .ShowCreator}}`, `name="creator"`, `{{.CreatorText}}`, `>筛选</button>`,
|
||||
},
|
||||
"templates/task/detail_modal.html": {`<dt>创建人</dt><dd>{{.CreatorText}}</dd>`},
|
||||
}
|
||||
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 TestTemplatesAndRoutesCanBeBuiltWithoutDatabaseConnection(t *testing.T) {
|
||||
if _, err := newRouter(nil); err != nil {
|
||||
t.Fatalf("模板或路由组装失败: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user