package portal import "testing" func TestResourceTypeSupported(t *testing.T) { for _, kind := range []string{"mcp_server", "skill", "digital_employee", "channel", " MCP_SERVER "} { if !resourceTypeSupported(kind) { t.Errorf("kind %q should be supported", kind) } } for _, kind := range []string{"model", "tool", "", "wecom"} { if resourceTypeSupported(kind) { t.Errorf("kind %q should not be supported", kind) } } } func TestPersonalChannelCodePattern(t *testing.T) { for _, code := range []string{"my_bot", "report-bot", "ab1", "chat2"} { if !personalChannelCodePattern.MatchString(code) { t.Errorf("code %q should match", code) } } for _, code := range []string{"Bot", "1bot", "b", "has space", "x!y"} { if personalChannelCodePattern.MatchString(code) { t.Errorf("code %q should not match", code) } } }