@@ -1147,7 +1147,6 @@ describe('InputPrompt', () => {
11471147 await waitFor ( ( ) => {
11481148 expect ( mockedUseCommandCompletion ) . toHaveBeenCalledWith (
11491149 mockBuffer ,
1150- [ '/test/project/src' ] ,
11511150 path . join ( 'test' , 'project' , 'src' ) ,
11521151 mockSlashCommands ,
11531152 mockCommandContext ,
@@ -2268,6 +2267,7 @@ describe('InputPrompt', () => {
22682267 describe ( 'queued message editing' , ( ) => {
22692268 it ( 'should load all queued messages when up arrow is pressed with empty input' , async ( ) => {
22702269 const mockPopAllMessages = vi . fn ( ) ;
2270+ mockPopAllMessages . mockReturnValue ( 'Message 1\n\nMessage 2\n\nMessage 3' ) ;
22712271 props . popAllMessages = mockPopAllMessages ;
22722272 props . buffer . text = '' ;
22732273
@@ -2279,11 +2279,7 @@ describe('InputPrompt', () => {
22792279 stdin . write ( '\u001B[A' ) ;
22802280 } ) ;
22812281 await waitFor ( ( ) => expect ( mockPopAllMessages ) . toHaveBeenCalled ( ) ) ;
2282- const callback = mockPopAllMessages . mock . calls [ 0 ] [ 0 ] ;
22832282
2284- await act ( async ( ) => {
2285- callback ( 'Message 1\n\nMessage 2\n\nMessage 3' ) ;
2286- } ) ;
22872283 expect ( props . buffer . setText ) . toHaveBeenCalledWith (
22882284 'Message 1\n\nMessage 2\n\nMessage 3' ,
22892285 ) ;
@@ -2311,6 +2307,7 @@ describe('InputPrompt', () => {
23112307
23122308 it ( 'should handle undefined messages from popAllMessages' , async ( ) => {
23132309 const mockPopAllMessages = vi . fn ( ) ;
2310+ mockPopAllMessages . mockReturnValue ( undefined ) ;
23142311 props . popAllMessages = mockPopAllMessages ;
23152312 props . buffer . text = '' ;
23162313
@@ -2322,10 +2319,6 @@ describe('InputPrompt', () => {
23222319 stdin . write ( '\u001B[A' ) ;
23232320 } ) ;
23242321 await waitFor ( ( ) => expect ( mockPopAllMessages ) . toHaveBeenCalled ( ) ) ;
2325- const callback = mockPopAllMessages . mock . calls [ 0 ] [ 0 ] ;
2326- await act ( async ( ) => {
2327- callback ( undefined ) ;
2328- } ) ;
23292322
23302323 expect ( props . buffer . setText ) . not . toHaveBeenCalled ( ) ;
23312324 expect ( mockInputHistory . navigateUp ) . toHaveBeenCalled ( ) ;
@@ -2353,6 +2346,7 @@ describe('InputPrompt', () => {
23532346
23542347 it ( 'should handle single queued message' , async ( ) => {
23552348 const mockPopAllMessages = vi . fn ( ) ;
2349+ mockPopAllMessages . mockReturnValue ( 'Single message' ) ;
23562350 props . popAllMessages = mockPopAllMessages ;
23572351 props . buffer . text = '' ;
23582352
@@ -2365,11 +2359,6 @@ describe('InputPrompt', () => {
23652359 } ) ;
23662360 await waitFor ( ( ) => expect ( mockPopAllMessages ) . toHaveBeenCalled ( ) ) ;
23672361
2368- const callback = mockPopAllMessages . mock . calls [ 0 ] [ 0 ] ;
2369- await act ( async ( ) => {
2370- callback ( 'Single message' ) ;
2371- } ) ;
2372-
23732362 expect ( props . buffer . setText ) . toHaveBeenCalledWith ( 'Single message' ) ;
23742363 unmount ( ) ;
23752364 } ) ;
@@ -2409,6 +2398,7 @@ describe('InputPrompt', () => {
24092398
24102399 it ( 'should navigate input history on fresh start when no queued messages exist' , async ( ) => {
24112400 const mockPopAllMessages = vi . fn ( ) ;
2401+ mockPopAllMessages . mockReturnValue ( undefined ) ;
24122402 props . popAllMessages = mockPopAllMessages ;
24132403 props . buffer . text = '' ;
24142404
@@ -2421,11 +2411,6 @@ describe('InputPrompt', () => {
24212411 } ) ;
24222412 await waitFor ( ( ) => expect ( mockPopAllMessages ) . toHaveBeenCalled ( ) ) ;
24232413
2424- const callback = mockPopAllMessages . mock . calls [ 0 ] [ 0 ] ;
2425- await act ( async ( ) => {
2426- callback ( undefined ) ;
2427- } ) ;
2428-
24292414 expect ( mockInputHistory . navigateUp ) . toHaveBeenCalled ( ) ;
24302415 expect ( props . buffer . setText ) . not . toHaveBeenCalled ( ) ;
24312416
0 commit comments