@@ -498,7 +498,7 @@ describe("command-executor", () => {
498498
499499 executeTerminalCommand ( button , mockTerminalExecutor ) ;
500500
501- expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , false , undefined ) ;
501+ expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , false , undefined , "Test Button" , expect . objectContaining ( { command : "echo test" , name : "Test Button" } ) ) ;
502502 } ) ;
503503
504504 it ( "should call terminalExecutor with useVsCodeApi true" , ( ) => {
@@ -511,7 +511,7 @@ describe("command-executor", () => {
511511
512512 executeTerminalCommand ( button , mockTerminalExecutor ) ;
513513
514- expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , true , undefined ) ;
514+ expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , true , undefined , "Test Button" , expect . objectContaining ( { command : "echo test" , name : "Test Button" , useVsCodeApi : true } ) ) ;
515515 } ) ;
516516
517517 it ( "should call terminalExecutor with custom terminal name" , ( ) => {
@@ -524,7 +524,7 @@ describe("command-executor", () => {
524524
525525 executeTerminalCommand ( button , mockTerminalExecutor ) ;
526526
527- expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , false , "Custom Terminal" ) ;
527+ expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , false , "Custom Terminal" , "Test Button" , expect . objectContaining ( { command : "echo test" , name : "Test Button" , terminalName : "Custom Terminal" } ) ) ;
528528 } ) ;
529529
530530 it ( "should call terminalExecutor with all parameters" , ( ) => {
@@ -538,7 +538,7 @@ describe("command-executor", () => {
538538
539539 executeTerminalCommand ( button , mockTerminalExecutor ) ;
540540
541- expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , true , "Custom Terminal" ) ;
541+ expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo test" , true , "Custom Terminal" , "Test Button" , expect . objectContaining ( { command : "echo test" , name : "Test Button" , terminalName : "Custom Terminal" , useVsCodeApi : true } ) ) ;
542542 } ) ;
543543
544544 it ( "should not call terminalExecutor when command is undefined" , ( ) => {
@@ -588,13 +588,14 @@ describe("command-executor", () => {
588588 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
589589
590590 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 3 ) ;
591- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo test1" , false , undefined ) ;
592- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo test2" , true , undefined ) ;
591+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo test1" , false , undefined , "Command 1[0]" ) ;
592+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo test2" , true , undefined , "Command 2[1]" ) ;
593593 expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith (
594594 3 ,
595595 "echo test3" ,
596596 false ,
597- "Custom Terminal"
597+ "Custom Terminal" ,
598+ "Command 3[2]"
598599 ) ;
599600 } ) ;
600601
@@ -621,8 +622,8 @@ describe("command-executor", () => {
621622 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
622623
623624 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 2 ) ;
624- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo child1" , false , undefined ) ;
625- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo child2" , true , undefined ) ;
625+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo child1" , false , undefined , "Group Command[0]>Child 1[0]" ) ;
626+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo child2" , true , undefined , "Group Command[0]>Child 2[1]" ) ;
626627 } ) ;
627628
628629 it ( "should not execute commands for buttons with groups but no executeAll flag" , ( ) => {
@@ -673,8 +674,8 @@ describe("command-executor", () => {
673674 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
674675
675676 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 2 ) ;
676- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo level3" , false , undefined ) ;
677- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo level2" , false , undefined ) ;
677+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo level3" , false , undefined , "Level 1 Group[0]>Level 2 Group[0]>Level 3 Command[0]" ) ;
678+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo level2" , false , undefined , "Level 1 Group[0]>Level 2 Command[1]" ) ;
678679 } ) ;
679680
680681 it ( "should skip buttons without commands and without groups" , ( ) => {
@@ -692,7 +693,7 @@ describe("command-executor", () => {
692693 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
693694
694695 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 1 ) ;
695- expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo valid" , false , undefined ) ;
696+ expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo valid" , false , undefined , "Valid Command[0]" ) ;
696697 } ) ;
697698
698699 it ( "should skip buttons with empty command strings" , ( ) => {
@@ -711,7 +712,7 @@ describe("command-executor", () => {
711712 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
712713
713714 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 1 ) ;
714- expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo valid" , false , undefined ) ;
715+ expect ( mockTerminalExecutor ) . toHaveBeenCalledWith ( "echo valid" , false , undefined , "Valid Command[0]" ) ;
715716 } ) ;
716717
717718 it ( "should handle empty commands array" , ( ) => {
@@ -758,8 +759,8 @@ describe("command-executor", () => {
758759 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
759760
760761 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 2 ) ;
761- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo regular" , false , undefined ) ;
762- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo child" , false , undefined ) ;
762+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo regular" , false , undefined , "Regular Command[0]" ) ;
763+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo child" , false , undefined , "Group with executeAll[1]>Child Command[0]" ) ;
763764 } ) ;
764765
765766 it ( "should handle complex nested structure with mixed executeAll flags" , ( ) => {
@@ -804,9 +805,9 @@ describe("command-executor", () => {
804805 executeCommandsRecursively ( commands , mockTerminalExecutor ) ;
805806
806807 expect ( mockTerminalExecutor ) . toHaveBeenCalledTimes ( 3 ) ;
807- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo leaf1" , false , undefined ) ;
808- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo leaf2" , false , undefined ) ;
809- expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 3 , "echo direct" , false , undefined ) ;
808+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 1 , "echo leaf1" , false , undefined , "Root Group[0]>Branch 1[0]>Leaf 1[0]" ) ;
809+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 2 , "echo leaf2" , false , undefined , "Root Group[0]>Branch 1[0]>Leaf 2[1]" ) ;
810+ expect ( mockTerminalExecutor ) . toHaveBeenNthCalledWith ( 3 , "echo direct" , false , undefined , "Root Group[0]>Direct Command[2]" ) ;
810811 } ) ;
811812 } ) ;
812813} ) ;
0 commit comments