From 03f1701cdf3d571bbbd5aa19e97636abeec1aaa8 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 9 Jun 2026 19:36:50 -0700 Subject: [PATCH] FN-6150: deflake workflow editor save tests Wait for workflow editor hydration before exercising save and rename flows. - wait for the Save action and column inputs to render before editing workflow names - switch the rename clicks to synchronous lookups after hydration to avoid async race flakiness - keep the coverage focused on the existing save-and-close and dirty-switch scenarios Files changed: .../app/components/__tests__/WorkflowNodeEditor.test.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) Fusion-Task-Id: FN-6150 Fusion-Task-Lineage: 98044a22-3f07-4a58-ad61-19ba6b372565 --- .../app/components/__tests__/WorkflowNodeEditor.test.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx b/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx index 8c61f24154..4c15e741ff 100644 --- a/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx +++ b/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx @@ -1685,8 +1685,10 @@ describe("WorkflowNodeEditor — U4 create dialog / delete / inline rename / dir const onClose = vi.fn(); vi.mocked(fetchWorkflows).mockResolvedValue([v2Def()]); renderWithConfirm( {}} />); + await screen.findByText("Save"); + await waitFor(() => expect(screen.getAllByLabelText(/Column name/i).length).toBeGreaterThan(0)); // Make an edit: inline rename. - fireEvent.click(await screen.findByTestId("wf-workflow-name")); + fireEvent.click(screen.getByTestId("wf-workflow-name")); const input = await screen.findByTestId("wf-workflow-name-input"); fireEvent.change(input, { target: { value: "Edited" } }); fireEvent.keyDown(input, { key: "Enter" }); @@ -1711,8 +1713,10 @@ describe("WorkflowNodeEditor — U4 create dialog / delete / inline rename / dir { ...v2Def(), id: "WF-OTHER", name: "Other" }, ]); renderWithConfirm( {}} addToast={() => {}} />); + await screen.findByText("Save"); + await waitFor(() => expect(screen.getAllByLabelText(/Column name/i).length).toBeGreaterThan(0)); // Edit the active workflow. - fireEvent.click(await screen.findByTestId("wf-workflow-name")); + fireEvent.click(screen.getByTestId("wf-workflow-name")); const input = await screen.findByTestId("wf-workflow-name-input"); fireEvent.change(input, { target: { value: "Edited" } }); fireEvent.keyDown(input, { key: "Enter" });