Skip to content

Commit 8302c9f

Browse files
committed
test(core): fix cluster health check prompt test
Signed-off-by: Rohit Patil <[email protected]>
1 parent 7a9a8ff commit 8302c9f

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

pkg/toolsets/core/health_check_test.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@ import (
44
"testing"
55

66
"github.com/stretchr/testify/suite"
7-
8-
"github.com/containers/kubernetes-mcp-server/pkg/prompts"
97
)
108

119
type ClusterHealthCheckSuite struct {
1210
suite.Suite
1311
}
1412

1513
func (s *ClusterHealthCheckSuite) TestPromptIsRegistered() {
16-
s.Run("cluster-health-check prompt is registered", func() {
17-
configPrompts := prompts.ConfigPrompts()
14+
s.Run("cluster-health-check prompt is registered via GetPrompts", func() {
15+
// Create a new instance of the core toolset
16+
toolset := &Toolset{}
17+
18+
// Get prompts from the toolset
19+
prompts := toolset.GetPrompts()
20+
21+
s.Require().NotNil(prompts, "GetPrompts should not return nil")
22+
s.Require().NotEmpty(prompts, "GetPrompts should return at least one prompt")
1823

24+
// Find the cluster-health-check prompt
1925
var foundHealthCheck bool
20-
for _, prompt := range configPrompts {
26+
for _, prompt := range prompts {
2127
if prompt.Prompt.Name == "cluster-health-check" {
2228
foundHealthCheck = true
2329

@@ -31,14 +37,17 @@ func (s *ClusterHealthCheckSuite) TestPromptIsRegistered() {
3137

3238
// Check namespace argument
3339
s.Equal("namespace", prompt.Prompt.Arguments[0].Name)
40+
s.NotEmpty(prompt.Prompt.Arguments[0].Description)
3441
s.False(prompt.Prompt.Arguments[0].Required)
3542

3643
// Check verbose argument
3744
s.Equal("verbose", prompt.Prompt.Arguments[1].Name)
45+
s.NotEmpty(prompt.Prompt.Arguments[1].Description)
3846
s.False(prompt.Prompt.Arguments[1].Required)
3947

4048
// Check check_events argument
4149
s.Equal("check_events", prompt.Prompt.Arguments[2].Name)
50+
s.NotEmpty(prompt.Prompt.Arguments[2].Description)
4251
s.False(prompt.Prompt.Arguments[2].Required)
4352

4453
// Verify handler is set

0 commit comments

Comments
 (0)