From a0cf90b7d8b9ffbe02dbad2a7dcfc32add41b27a Mon Sep 17 00:00:00 2001 From: Suguru Inoue Date: Tue, 29 Jul 2025 13:29:24 +0200 Subject: [PATCH] fix(editor): Fix flaky unit test in editor UI (no-changelog) (#17787) --- .../editor-ui/src/composables/useRunWorkflow.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/frontend/editor-ui/src/composables/useRunWorkflow.test.ts b/packages/frontend/editor-ui/src/composables/useRunWorkflow.test.ts index ed0d6238df..21c4edd333 100644 --- a/packages/frontend/editor-ui/src/composables/useRunWorkflow.test.ts +++ b/packages/frontend/editor-ui/src/composables/useRunWorkflow.test.ts @@ -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({