style: 优化顺运宝列表筛选与滚动 (#216)
This commit is contained in:
@@ -316,6 +316,63 @@ func TestSybPage_明确展示蝦皮商品Pdd关联来源(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSybPage_紧凑筛选和可见横向滚动(t *testing.T) {
|
||||
page, err := os.ReadFile("templates/syb/list.html")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
css, err := os.ReadFile("static/css/app.css")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
header, err := os.ReadFile("templates/partials/header.html")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
pageText := string(page)
|
||||
for _, want := range []string{
|
||||
`class="syb-search-input"`,
|
||||
`>清除</a>`,
|
||||
`class="table-wrap syb-table-wrap"`,
|
||||
`class="syb-col-shop"`,
|
||||
`class="syb-col-spec"`,
|
||||
`colspan="12"`,
|
||||
} {
|
||||
if !strings.Contains(pageText, want) {
|
||||
t.Errorf("顺运宝紧凑列表缺少 %q", want)
|
||||
}
|
||||
}
|
||||
for _, removed := range []string{
|
||||
`href="/shops">店铺管理(同步`,
|
||||
`<th>货运单 ID</th>`,
|
||||
`每行只显示当前最需要完成的下一步`,
|
||||
} {
|
||||
if strings.Contains(pageText, removed) {
|
||||
t.Errorf("顺运宝列表仍包含已移除内容 %q", removed)
|
||||
}
|
||||
}
|
||||
for _, want := range []string{
|
||||
`.toolbar input[type="text"].syb-search-input`,
|
||||
`flex: 0 0 140px`,
|
||||
`.syb-col-shop`,
|
||||
`max-width: 224px`,
|
||||
`.syb-col-spec`,
|
||||
`max-width: 140px`,
|
||||
`.syb-table-wrap`,
|
||||
`max-height: calc(100vh - 270px)`,
|
||||
`overflow: auto`,
|
||||
`.syb-table-wrap thead th`,
|
||||
`position: sticky`,
|
||||
} {
|
||||
if !strings.Contains(string(css), want) {
|
||||
t.Errorf("顺运宝紧凑列表样式缺少 %q", want)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(string(header), `href="/shops"`) {
|
||||
t.Error("移除顺运宝工具条入口后,管理员主导航仍应保留店铺管理模块")
|
||||
}
|
||||
}
|
||||
|
||||
func TestShops_单一名称和状态且保护删除(t *testing.T) {
|
||||
templateContent, err := os.ReadFile("templates/shop/list.html")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user