fix: fixed flaky pipelineSearchSection test case (#5189)

This commit is contained in:
SagarRajput-7 2024-06-13 10:40:49 +05:30 committed by GitHub
parent a681f6f397
commit 1f4a8b9834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,9 +42,11 @@ describe('PipelinePage container test', () => {
jest.advanceTimersByTime(299);
expect(setPipelineValue).not.toHaveBeenCalled();
// Wait for the debounce delay to pass
// Fast-forward time by 1ms to reach the debounce delay
jest.advanceTimersByTime(1);
// Wait for the debounce delay to pass and expect the callback to be called
await waitFor(() => {
// Expect the callback to be called after debounce delay
expect(setPipelineValue).toHaveBeenCalledWith('sample_pipeline');
});