Search: runAllTimers => runOnlyPendingTimers (#35509)

This commit is contained in:
Alex Khomenko 2021-06-11 12:45:18 +03:00 committed by GitHub
parent 97a59a4855
commit 8e827337ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,7 +28,7 @@ const setup = (testProps?: Partial<Props>) => {
...testProps,
};
render(<DashboardSearch {...props} />);
jest.runAllTimers();
jest.runOnlyPendingTimers();
};
/**
@ -63,7 +63,7 @@ describe('DashboardSearch', () => {
const input = await screen.findByPlaceholderText('Search dashboards by name');
await act((async () => {
await fireEvent.input(input, { target: { value: 'Test' } });
jest.runAllTimers();
jest.runOnlyPendingTimers();
}) as any);
expect(mockSearch).toHaveBeenCalledWith({