mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-12 06:10:42 -07:00
Fix tests to wrap all calls changing the UI with act. (#12268)
This commit is contained in:
@@ -407,7 +407,9 @@ describe('useReactToolScheduler', () => {
|
||||
]);
|
||||
|
||||
// Clean up the pending promise to avoid open handles.
|
||||
resolveExecute({ llmContent: 'output', returnDisplay: 'display' });
|
||||
await act(async () => {
|
||||
resolveExecute({ llmContent: 'output', returnDisplay: 'display' });
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle tool not found', async () => {
|
||||
@@ -854,7 +856,9 @@ describe('useReactToolScheduler', () => {
|
||||
await vi.advanceTimersByTimeAsync(0);
|
||||
});
|
||||
|
||||
schedule(request2, new AbortController().signal);
|
||||
act(() => {
|
||||
schedule(request2, new AbortController().signal);
|
||||
});
|
||||
|
||||
await act(async () => {
|
||||
await vi.advanceTimersByTimeAsync(50);
|
||||
|
||||
Reference in New Issue
Block a user