fix: accept AI table link cards in settings

This commit is contained in:
姚章浩
2026-08-14 10:46:51 +08:00
parent 365f1b8c7d
commit b4b68d8b21
4 changed files with 160 additions and 1 deletions
+27
View File
@@ -157,6 +157,33 @@ func TestControllerAcceptsTableLinkInNextMessage(t *testing.T) {
t.Fatal("setting session must be cleared")
}
}
func TestControllerFAQBindingPromptExplainsPermissionsSchemaActivationAndLinkCards(t *testing.T) {
r := newMemoryRepo()
r.admins["t/a"] = true
c := NewController(r)
out, err := c.Handle(context.Background(), SettingInput{TenantKey: "t", Channel: "dingtalk", StaffID: "a", Text: "/setting faq", ConversationType: "direct"})
if err != nil {
t.Fatal(err)
}
for _, want := range []string{
"10分钟",
"链接卡片",
"机器人应用",
"管理员",
"标准问题(必填)",
"原始问题",
"语言",
"提问人",
"立即激活FAQ写入",
"短暂重启DobotAI",
"取消",
} {
if !strings.Contains(out, want) {
t.Fatalf("reply=%q must contain %q", out, want)
}
}
}
func TestControllerDetectsBootstrapCandidate(t *testing.T) {
r := newMemoryRepo()
c := NewController(r)