FN-6061: stabilize WorkflowNodeEditor rename race test

Wait for the workflow editor to finish hydrating before exercising the inline rename flow.

- wait for the Save action and rendered column inputs before clicking the workflow name strip
- switch the workflow name click to a synchronous lookup once the editor is stable
- preserve the dirty-rename cancel assertion while removing the hydration race from the test

Files changed:
 packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6061

Fusion-Task-Lineage: 3c7d781c-c1de-4c8f-9c15-670d5bf8193f
This commit is contained in:
gsxdsm
2026-06-09 03:17:20 -07:00
parent 89322412cc
commit 3252236528

View File

@@ -2222,8 +2222,12 @@ describe("WorkflowNodeEditor — U10 design-with-AI", () => {
vi.mocked(designWorkflow).mockResolvedValue(designedResult());
renderWithConfirm(<WorkflowNodeEditor isOpen onClose={() => {}} addToast={() => {}} />);
// Wait for the editor to fully stabilize before interacting — clicking
// the name strip mid-hydration races the initial render cycle.
await screen.findByText("Save");
await waitFor(() => expect(screen.getAllByLabelText(/Column name/i).length).toBeGreaterThan(0));
// Make a dirty edit first (inline rename) so we can prove it survives a cancel.
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: "Kept name" } });
fireEvent.keyDown(input, { key: "Enter" });