(t *testing.T)
| 108 | } |
| 109 | |
| 110 | func 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. |
| 128 | func captureListOutput(t *testing.T, dir, pattern string) string { |
nothing calls this directly
no test coverage detected