@@ -120,7 +120,15 @@ func TestCreateCommand(t *testing.T) {
120120 CmdArgs : []string {"agent" },
121121 Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
122122 cm .IO .On ("IsTTY" ).Return (true )
123- // Should skip category prompt and go directly to language selection
123+ // Should skip category prompt and go directly to template selection
124+ cm .IO .On ("SelectPrompt" , mock .Anything , "Select a template:" , mock .Anything , mock .Anything ).
125+ Return (
126+ iostreams.SelectPromptResponse {
127+ Prompt : true ,
128+ Index : 1 , // Select Custom Agent
129+ },
130+ nil ,
131+ )
124132 cm .IO .On ("SelectPrompt" , mock .Anything , "Select a language:" , mock .Anything , mock .Anything ).
125133 Return (
126134 iostreams.SelectPromptResponse {
@@ -151,7 +159,15 @@ func TestCreateCommand(t *testing.T) {
151159 "creates an agent app with app name using agent argument" : {
152160 CmdArgs : []string {"agent" , "my-agent-app" },
153161 Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
154- // Should skip category prompt and go directly to language selection
162+ // Should skip category prompt and go directly to template selection
163+ cm .IO .On ("SelectPrompt" , mock .Anything , "Select a template:" , mock .Anything , mock .Anything ).
164+ Return (
165+ iostreams.SelectPromptResponse {
166+ Prompt : true ,
167+ Index : 1 , // Select Custom Agent
168+ },
169+ nil ,
170+ )
155171 cm .IO .On ("SelectPrompt" , mock .Anything , "Select a language:" , mock .Anything , mock .Anything ).
156172 Return (
157173 iostreams.SelectPromptResponse {
@@ -178,12 +194,9 @@ func TestCreateCommand(t *testing.T) {
178194 cm .IO .AssertNotCalled (t , "InputPrompt" , mock .Anything , "Name your app:" , mock .Anything )
179195 },
180196 },
181- "creates a pydantic ai agent app with templates experiment " : {
197+ "creates a pydantic ai agent app" : {
182198 CmdArgs : []string {"my-pydantic-app" },
183199 Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
184- cm .AddDefaultMocks ()
185- cm .Config .ExperimentsFlag = append (cm .Config .ExperimentsFlag , "templates" )
186- cm .Config .LoadExperiments (ctx , cm .IO .PrintDebug )
187200 cm .IO .On ("SelectPrompt" , mock .Anything , "Select an app:" , mock .Anything , mock .Anything ).
188201 Return (iostreams.SelectPromptResponse {Prompt : true , Index : 1 }, nil )
189202 cm .IO .On ("SelectPrompt" , mock .Anything , "Select a template:" , mock .Anything , mock .Anything ).
@@ -283,6 +296,14 @@ func TestCreateCommand(t *testing.T) {
283296 CmdArgs : []string {"agent" , "--name" , "my-custom-name" },
284297 Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
285298 // Should skip category prompt due to agent shortcut
299+ cm .IO .On ("SelectPrompt" , mock .Anything , "Select a template:" , mock .Anything , mock .Anything ).
300+ Return (
301+ iostreams.SelectPromptResponse {
302+ Prompt : true ,
303+ Index : 1 , // Select Custom Agent
304+ },
305+ nil ,
306+ )
286307 cm .IO .On ("SelectPrompt" , mock .Anything , "Select a language:" , mock .Anything , mock .Anything ).
287308 Return (
288309 iostreams.SelectPromptResponse {
@@ -346,6 +367,14 @@ func TestCreateCommand(t *testing.T) {
346367 CmdArgs : []string {"agent" , "my-project" , "--name" , "my-name" },
347368 Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
348369 // Should skip category prompt due to agent shortcut
370+ cm .IO .On ("SelectPrompt" , mock .Anything , "Select a template:" , mock .Anything , mock .Anything ).
371+ Return (
372+ iostreams.SelectPromptResponse {
373+ Prompt : true ,
374+ Index : 1 , // Select Custom Agent
375+ },
376+ nil ,
377+ )
349378 cm .IO .On ("SelectPrompt" , mock .Anything , "Select a language:" , mock .Anything , mock .Anything ).
350379 Return (
351380 iostreams.SelectPromptResponse {
@@ -567,49 +596,6 @@ func TestCreateCommand(t *testing.T) {
567596 createClientMock = new (CreateClientMock )
568597 CreateFunc = createClientMock .Create
569598 },
570- ExpectedOutputs : []string {
571- "Getting started" ,
572- "AI Agent apps" ,
573- "Automation apps" ,
574- "slack-samples/bolt-js-starter-template" ,
575- "slack-samples/bolt-python-starter-template" ,
576- "slack-samples/bolt-js-assistant-template" ,
577- "slack-samples/bolt-python-assistant-template" ,
578- "slack-samples/bolt-js-custom-function-template" ,
579- "slack-samples/bolt-python-custom-function-template" ,
580- "slack-samples/deno-starter-template" ,
581- },
582- ExpectedAsserts : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock ) {
583- createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything )
584- },
585- },
586- "lists agent templates with agent --list flag" : {
587- CmdArgs : []string {"agent" , "--list" },
588- Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
589- createClientMock = new (CreateClientMock )
590- CreateFunc = createClientMock .Create
591- },
592- ExpectedOutputs : []string {
593- "AI Agent apps" ,
594- "slack-samples/bolt-js-assistant-template" ,
595- "slack-samples/bolt-python-assistant-template" ,
596- },
597- ExpectedAsserts : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock ) {
598- createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything )
599- output := cm .GetCombinedOutput ()
600- assert .NotContains (t , output , "Getting started" )
601- assert .NotContains (t , output , "Automation apps" )
602- },
603- },
604- "lists all templates with --list flag and templates experiment" : {
605- CmdArgs : []string {"--list" },
606- Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
607- cm .AddDefaultMocks ()
608- cm .Config .ExperimentsFlag = append (cm .Config .ExperimentsFlag , "templates" )
609- cm .Config .LoadExperiments (ctx , cm .IO .PrintDebug )
610- createClientMock = new (CreateClientMock )
611- CreateFunc = createClientMock .Create
612- },
613599 ExpectedOutputs : []string {
614600 "Getting started" ,
615601 "slack-samples/bolt-js-starter-template" ,
@@ -630,12 +616,9 @@ func TestCreateCommand(t *testing.T) {
630616 createClientMock .AssertNotCalled (t , "Create" , mock .Anything , mock .Anything , mock .Anything )
631617 },
632618 },
633- "lists agent templates with agent --list flag and templates experiment " : {
619+ "lists agent templates with agent --list flag" : {
634620 CmdArgs : []string {"agent" , "--list" },
635621 Setup : func (t * testing.T , ctx context.Context , cm * shared.ClientsMock , cf * shared.ClientFactory ) {
636- cm .AddDefaultMocks ()
637- cm .Config .ExperimentsFlag = append (cm .Config .ExperimentsFlag , "templates" )
638- cm .Config .LoadExperiments (ctx , cm .IO .PrintDebug )
639622 createClientMock = new (CreateClientMock )
640623 CreateFunc = createClientMock .Create
641624 },
0 commit comments