48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package cli_test
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/DingTalk-Real-AI/dingtalk-workspace-cli/internal/app"
|
|
)
|
|
|
|
// TestRootHelpShowsDiscoveredMCPServicesOnly was removed
|
|
// because it depended on hardcoded product names (aiapp, aitable, teambition)
|
|
// that are no longer guaranteed to be available. In the protocol-first
|
|
// MCP architecture, products are discovered dynamically from MCP servers,
|
|
// and their availability depends on the test environment's fixture data.
|
|
|
|
func TestPublicMCPHelpShowsReviewedURLCommand(t *testing.T) {
|
|
cmd := app.NewRootCommand()
|
|
var out strings.Builder
|
|
cmd.SetOut(&out)
|
|
cmd.SetErr(&out)
|
|
cmd.SetArgs([]string{"mcp", "--help"})
|
|
|
|
if err := cmd.Execute(); err != nil {
|
|
t.Fatalf("Execute() error = %v", err)
|
|
}
|
|
|
|
got := out.String()
|
|
if !strings.Contains(got, "管理经过审核并纳入 Schema 的 MCP 服务连接辅助能力") ||
|
|
!strings.Contains(got, "url") {
|
|
t.Fatalf("mcp help missing expected text:\n%s", got)
|
|
}
|
|
}
|
|
|
|
func TestSkillCommandIsRegistered(t *testing.T) {
|
|
root := app.NewRootCommand()
|
|
|
|
var found bool
|
|
for _, cmd := range root.Commands() {
|
|
if cmd.Name() == "skill" {
|
|
found = true
|
|
break
|
|
}
|
|
}
|
|
if !found {
|
|
t.Fatalf("skill command should be registered")
|
|
}
|
|
}
|