优化快捷回复 CSV 为中文四列模板,操作列改为单行
导入/导出统一为一级分类、二级分类、输入码、内容;列表操作按钮紧凑并排不换行。
This commit is contained in:
@@ -32,3 +32,33 @@ func TestNormalizeShortcut(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseQuickReplyScopeLabel(t *testing.T) {
|
||||
cases := []struct {
|
||||
in string
|
||||
want string
|
||||
wantOK bool
|
||||
}{
|
||||
{"团队", "team", true},
|
||||
{"个人", "personal", true},
|
||||
{"", "", true},
|
||||
{"team", "", false},
|
||||
{"personal", "", false},
|
||||
{"其它", "", false},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
got, ok := parseQuickReplyScopeLabel(tc.in)
|
||||
if ok != tc.wantOK || got != tc.want {
|
||||
t.Fatalf("parseQuickReplyScopeLabel(%q)=(%q,%v) want (%q,%v)", tc.in, got, ok, tc.want, tc.wantOK)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsQuickReplyCSVHeader(t *testing.T) {
|
||||
if !isQuickReplyCSVHeader([]string{"一级分类", "二级分类", "输入码", "内容"}) {
|
||||
t.Fatal("expected header match")
|
||||
}
|
||||
if isQuickReplyCSVHeader([]string{"title", "content", "shortcut", "group_name"}) {
|
||||
t.Fatal("legacy english header should not match")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user