fix(editor): Fix flaky unit test in editor UI (no-changelog) (#17787)

This commit is contained in:
Suguru Inoue
2025-07-29 13:29:24 +02:00
committed by GitHub
parent 1fb78cb0ea
commit a0cf90b7d8

View File

@@ -1054,7 +1054,10 @@ describe('useRunWorkflow({ router })', () => {
// Assert that markExecutionAsStopped() isn't called yet after a simulated delay
await new Promise((resolve) => setTimeout(resolve, 10));
expect(markStoppedSpy).not.toHaveBeenCalled();
expect(getExecutionSpy).toHaveBeenCalledWith('test-exec-id');
await waitFor(() => expect(getExecutionSpy).toHaveBeenCalledWith('test-exec-id'));
getExecutionSpy.mockReset();
expect(getExecutionSpy).toHaveBeenCalledTimes(0);
// Simulated executionFinished event
getExecutionSpy.mockResolvedValue({