File tree Expand file tree Collapse file tree
packages/app/src/cli/services/app-logs/logs-command/ui/components/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -404,6 +404,11 @@ describe('usePollAppLogs', () => {
404404 // needed to await the render
405405 await vi . advanceTimersByTimeAsync ( 0 )
406406
407+ // Wait for the async polling function to execute
408+ await waitForMockCalls ( mockedPollAppLogs , 1 )
409+ // Flush React 19 batched state updates so hook.lastResult reflects the new state
410+ await vi . advanceTimersByTimeAsync ( 0 )
411+
407412 // Initial invocation, 429 returned
408413 expect ( mockedPollAppLogs ) . toHaveBeenCalledTimes ( 1 )
409414
@@ -447,6 +452,11 @@ describe('usePollAppLogs', () => {
447452 // needed to await the render
448453 await vi . advanceTimersByTimeAsync ( 0 )
449454
455+ // Wait for the async polling function to execute
456+ await waitForMockCalls ( mockedPollAppLogs , 1 )
457+ // Flush React 19 batched state updates so hook.lastResult reflects the new state
458+ await vi . advanceTimersByTimeAsync ( 0 )
459+
450460 // Initial invocation, 422 returned
451461 expect ( mockedPollAppLogs ) . toHaveBeenCalledTimes ( 1 )
452462
You can’t perform that action at this time.
0 commit comments