@@ -278,8 +278,8 @@ describe("Unit - ai-config command", () => {
278278 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
279279 spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
280280 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
281- Promise . resolve ( [ "vscode " ] ) ,
282- Promise . resolve ( [ "claude " ] )
281+ Promise . resolve ( [ "claude " ] ) ,
282+ Promise . resolve ( [ "vscode " ] )
283283 ) ;
284284
285285 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
@@ -307,7 +307,6 @@ describe("Unit - ai-config command", () => {
307307 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
308308 spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
309309 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "none" ] ) ) ;
310- spyOn ( InquirerWrapper , "select" ) . and . returnValue ( Promise . resolve ( "vscode" ) ) ;
311310
312311 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
313312
@@ -319,25 +318,25 @@ describe("Unit - ai-config command", () => {
319318 it ( "still configures MCP when none is selected for skills" , async ( ) => {
320319 const mockFs = createMockFs ( ) ;
321320 App . container . set ( FS_TOKEN , mockFs ) ;
321+ spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
322322 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
323- Promise . resolve ( [ "vscode " ] ) ,
324- Promise . resolve ( [ "none " ] )
323+ Promise . resolve ( [ "none " ] ) ,
324+ Promise . resolve ( [ "vscode " ] )
325325 ) ;
326326
327327 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
328328
329- expect ( mockFs . writeFile ) . toHaveBeenCalled ( ) ;
330- // TODO: toHaveBeenCalledWith check for mcp.json
331329 expect ( GoogleAnalytics . post ) . toHaveBeenCalledWith ( jasmine . objectContaining ( { t : "screenview" , cd : "Ai Config" } ) ) ;
332- expect ( GoogleAnalytics . post ) . toHaveBeenCalledWith ( jasmine . objectContaining ( { ea : "agent: none; assistant: none" } ) ) ;
330+ expect ( GoogleAnalytics . post ) . toHaveBeenCalledWith ( jasmine . objectContaining ( { ea : "agent: none; assistant: vscode" } ) ) ;
331+ expect ( Util . log ) . toHaveBeenCalledWith ( jasmine . stringContaining ( "Skipping" ) ) ;
333332 } ) ;
334333
335334 it ( "configures multiple agents when selected interactively" , async ( ) => {
336335 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
337336 spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
338337 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
339- Promise . resolve ( [ "vscode " ] ) ,
340- Promise . resolve ( [ "claude" , "cursor "] )
338+ Promise . resolve ( [ "claude" , "cursor "] ) ,
339+ Promise . resolve ( [ "vscode " ] )
341340 ) ;
342341
343342 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
@@ -350,6 +349,7 @@ describe("Unit - ai-config command", () => {
350349
351350 it ( "skips prompt when --agent is provided" , async ( ) => {
352351 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
352+ spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
353353 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "vscode" ] ) ) ;
354354
355355 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" , agent : [ "cursor" ] } ) ;
@@ -362,6 +362,7 @@ describe("Unit - ai-config command", () => {
362362
363363 it ( "skips assistant prompt when --assistant is provided" , async ( ) => {
364364 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
365+ spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
365366 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValue ( Promise . resolve ( [ "claude" ] ) ) ;
366367
367368 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" , assistant : [ "cursor" ] } ) ;
@@ -371,9 +372,10 @@ describe("Unit - ai-config command", () => {
371372
372373 it ( "prompts for assistant with correct message" , async ( ) => {
373374 App . container . set ( FS_TOKEN , createMockFs ( ) ) ;
375+ spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
374376 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
375- Promise . resolve ( [ "cursor " ] ) ,
376- Promise . resolve ( [ "claude " ] )
377+ Promise . resolve ( [ "claude " ] ) ,
378+ Promise . resolve ( [ "vscode " ] )
377379 ) ;
378380
379381 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
@@ -386,9 +388,10 @@ describe("Unit - ai-config command", () => {
386388 it ( "writes to correct config path for selected assistant" , async ( ) => {
387389 const mockFs = createMockFs ( ) ;
388390 App . container . set ( FS_TOKEN , mockFs ) ;
391+ spyOn ( Util , "canPrompt" ) . and . returnValue ( true ) ;
389392 spyOn ( InquirerWrapper , "checkbox" ) . and . returnValues (
390- Promise . resolve ( [ "claude-code " ] ) ,
391- Promise . resolve ( [ "none " ] )
393+ Promise . resolve ( [ "claude" ] ) ,
394+ Promise . resolve ( [ "claude-code " ] )
392395 ) ;
393396
394397 await aiConfig . default . handler ( { _ : [ "ai-config" ] , $0 : "ig" } ) ;
0 commit comments