From dd27a633c5342d80d61e8d6cfb821b2f3501db2c Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 9 Jun 2026 20:52:46 -0700 Subject: [PATCH] FN-6157: stabilize WorkflowNodeEditor U8 authoring test Guard the U8 authoring workflow test against editor hydration races. - wait for the workflow column panel before opening the Code palette - wait for the code node to render before reading the TypeScript source textarea - document the flake class to align this test with the existing palette-add race fix Files changed: .../dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-6157 Fusion-Task-Lineage: 4009cbb5-8217-4eae-8889-e047ec31bee3 --- .../app/components/__tests__/WorkflowNodeEditor.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx b/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx index 620bea75e4..1333a9c3f5 100644 --- a/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx +++ b/packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx @@ -1202,8 +1202,13 @@ describe("WorkflowNodeEditor — U8 step-inversion authoring", () => { vi.mocked(fetchWorkflows).mockResolvedValue([v2Def()]); render( {}} addToast={() => {}} />); await screen.findByText("Save"); + // Wait for graph/column hydration before driving the palette — clicking + // mid-hydration races the flow-state seeding and the added node may never + // render (same flake class as foreach palette add, 86867c57b). + expect(await screen.findByTestId("wf-column-panel")).toBeInTheDocument(); fireEvent.click(screen.getByText("Code").closest("button")!); - const source = (await screen.findByText("Source (TypeScript)")).parentElement!.querySelector("textarea")! as HTMLTextAreaElement; + await waitFor(() => expect(screen.getByTestId("wf-node-code")).toBeInTheDocument(), { timeout: 5000 }); + const source = screen.getByText("Source (TypeScript)").parentElement!.querySelector("textarea")! as HTMLTextAreaElement; fireEvent.change(source, { target: { value: "export default async()=>({outcome:'success'})" } }); expect(source.value).toContain("outcome:'success'"); const timeout = screen.getByText("Timeout (ms)").parentElement!.querySelector("input")! as HTMLInputElement;