@@ -320,6 +320,46 @@ func TestCreateCommand(t *testing.T) {
320320 cm .IO .AssertNotCalled (t , "SelectPrompt" , mock .Anything , "Select an app:" , mock .Anything , mock .Anything )
321321 },
322322 },
323+ "lists all templates with --list flag" : {
324+ CmdArgs : []string {"--list" },
325+ Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
326+ createClientMock = new (CreateClientMock )
327+ CreateFunc = createClientMock .Create
328+ },
329+ ExpectedOutputs : []string {
330+ "Getting started" ,
331+ "AI Agent apps" ,
332+ "Automation apps" ,
333+ "slack-samples/bolt-js-starter-template" ,
334+ "slack-samples/bolt-python-starter-template" ,
335+ "slack-samples/bolt-js-assistant-template" ,
336+ "slack-samples/bolt-python-assistant-template" ,
337+ "slack-samples/bolt-js-custom-function-template" ,
338+ "slack-samples/bolt-python-custom-function-template" ,
339+ "slack-samples/deno-starter-template" ,
340+ },
341+ ExpectedAsserts : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock ) {
342+ createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything , mock .Anything )
343+ },
344+ },
345+ "lists agent templates with agent --list flag" : {
346+ CmdArgs : []string {"agent" , "--list" },
347+ Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
348+ createClientMock = new (CreateClientMock )
349+ CreateFunc = createClientMock .Create
350+ },
351+ ExpectedOutputs : []string {
352+ "AI Agent apps" ,
353+ "slack-samples/bolt-js-assistant-template" ,
354+ "slack-samples/bolt-python-assistant-template" ,
355+ },
356+ ExpectedAsserts : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock ) {
357+ createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything , mock .Anything )
358+ output := cm .GetCombinedOutput ()
359+ assert .NotContains (t , output , "Getting started" )
360+ assert .NotContains (t , output , "Automation apps" )
361+ },
362+ },
323363 }, func (cf * shared.ClientFactory ) * cobra.Command {
324364 return NewCreateCommand (cf )
325365 })
0 commit comments