MCPcopy Create free account
hub / github.com/github/gh-aw / TestNewListCommand

Function TestNewListCommand

pkg/cli/list_workflows_command_test.go:110–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestNewListCommand(t *testing.T) {
111 cmd := NewListCommand()
112
113 // Verify command properties
114 assert.Equal(t, "list", cmd.Use[:4], "Command use should start with 'list'")
115 assert.NotEmpty(t, cmd.Short, "Command should have short description")
116 assert.NotEmpty(t, cmd.Long, "Command should have long description")
117 assert.NotNil(t, cmd.RunE, "Command should have RunE function")
118
119 // Verify flags exist
120 jsonFlag := cmd.Flags().Lookup("json")
121 assert.NotNil(t, jsonFlag, "Command should have --json flag")
122
123 labelFlag := cmd.Flags().Lookup("label")
124 assert.NotNil(t, labelFlag, "Command should have --label flag")
125}
126
127// captureListOutput calls RunListWorkflows and returns the captured stdout as a string.
128func captureListOutput(t *testing.T, dir, pattern string) string {

Callers

nothing calls this directly

Calls 1

NewListCommandFunction · 0.85

Tested by

no test coverage detected