@@ -414,6 +414,46 @@ func TestCreateCommand(t *testing.T) {
414414 cm .IO .AssertNotCalled (t , "InputPrompt" , mock .Anything , "Name your app:" , mock .Anything )
415415 },
416416 },
417+ "lists all templates with --list flag" : {
418+ CmdArgs : []string {"--list" },
419+ Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
420+ createClientMock = new (CreateClientMock )
421+ CreateFunc = createClientMock .Create
422+ },
423+ ExpectedOutputs : []string {
424+ "Getting started" ,
425+ "AI Agent apps" ,
426+ "Automation apps" ,
427+ "slack-samples/bolt-js-starter-template" ,
428+ "slack-samples/bolt-python-starter-template" ,
429+ "slack-samples/bolt-js-assistant-template" ,
430+ "slack-samples/bolt-python-assistant-template" ,
431+ "slack-samples/bolt-js-custom-function-template" ,
432+ "slack-samples/bolt-python-custom-function-template" ,
433+ "slack-samples/deno-starter-template" ,
434+ },
435+ ExpectedAsserts : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock ) {
436+ createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything , mock .Anything )
437+ },
438+ },
439+ "lists agent templates with agent --list flag" : {
440+ CmdArgs : []string {"agent" , "--list" },
441+ Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
442+ createClientMock = new (CreateClientMock )
443+ CreateFunc = createClientMock .Create
444+ },
445+ ExpectedOutputs : []string {
446+ "AI Agent apps" ,
447+ "slack-samples/bolt-js-assistant-template" ,
448+ "slack-samples/bolt-python-assistant-template" ,
449+ },
450+ ExpectedAsserts : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock ) {
451+ createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything , mock .Anything )
452+ output := cm .GetCombinedOutput ()
453+ assert .NotContains (t , output , "Getting started" )
454+ assert .NotContains (t , output , "Automation apps" )
455+ },
456+ },
417457 }, func (cf * shared.ClientFactory ) * cobra.Command {
418458 return NewCreateCommand (cf )
419459 })
0 commit comments