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
This commit is contained in:
gsxdsm
2026-06-09 20:52:46 -07:00
parent 59ee449ba1
commit dd27a633c5

View File

@@ -1202,8 +1202,13 @@ describe("WorkflowNodeEditor — U8 step-inversion authoring", () => {
vi.mocked(fetchWorkflows).mockResolvedValue([v2Def()]);
render(<WorkflowNodeEditor isOpen onClose={() => {}} 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;