diff --git a/frontend/src/container/PipelinePage/tests/PipelinesSearchSection.test.tsx b/frontend/src/container/PipelinePage/tests/PipelinesSearchSection.test.tsx index bfe69adcd1..2ef069a8f5 100644 --- a/frontend/src/container/PipelinePage/tests/PipelinesSearchSection.test.tsx +++ b/frontend/src/container/PipelinePage/tests/PipelinesSearchSection.test.tsx @@ -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'); });