File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,13 +143,16 @@ func TestExtractFlagGroups_AllAnnotationKeys(t *testing.T) {
143143}
144144
145145func TestBuildAgentContext_HiddenCommands (t * testing.T ) {
146- ctx := buildAgentContext (rootCmd )
147- spam := findAgentCommand (ctx .Commands , "campaigns" )
148- if spam == nil {
149- t .Fatal ("campaigns not found in output (hidden commands should still be included)" )
146+ root := & cobra.Command {Use : "root" }
147+ root .AddCommand (& cobra.Command {Use : "secret" , Hidden : true })
148+
149+ ctx := buildAgentContext (root )
150+ secret := findAgentCommand (ctx .Commands , "secret" )
151+ if secret == nil {
152+ t .Fatal ("secret not found in output (hidden commands should still be included)" )
150153 }
151- if ! spam .Hidden {
152- t .Error ("campaigns should be hidden=true" )
154+ if ! secret .Hidden {
155+ t .Error ("secret should be hidden=true" )
153156 }
154157}
155158
You can’t perform that action at this time.
0 commit comments