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
This commit is contained in:
gsxdsm
2026-06-09 19:36:50 -07:00
parent 477c8f1e03
commit 03f1701cdf

View File

@@ -1685,8 +1685,10 @@ describe("WorkflowNodeEditor — U4 create dialog / delete / inline rename / dir
const onClose = vi.fn(); const onClose = vi.fn();
vi.mocked(fetchWorkflows).mockResolvedValue([v2Def()]); vi.mocked(fetchWorkflows).mockResolvedValue([v2Def()]);
renderWithConfirm(<WorkflowNodeEditor isOpen onClose={onClose} addToast={() => {}} />); renderWithConfirm(<WorkflowNodeEditor isOpen onClose={onClose} addToast={() => {}} />);
await screen.findByText("Save");
await waitFor(() => expect(screen.getAllByLabelText(/Column name/i).length).toBeGreaterThan(0));
// Make an edit: inline rename. // 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"); const input = await screen.findByTestId("wf-workflow-name-input");
fireEvent.change(input, { target: { value: "Edited" } }); fireEvent.change(input, { target: { value: "Edited" } });
fireEvent.keyDown(input, { key: "Enter" }); fireEvent.keyDown(input, { key: "Enter" });
@@ -1711,8 +1713,10 @@ describe("WorkflowNodeEditor — U4 create dialog / delete / inline rename / dir
{ ...v2Def(), id: "WF-OTHER", name: "Other" }, { ...v2Def(), id: "WF-OTHER", name: "Other" },
]); ]);
renderWithConfirm(<WorkflowNodeEditor isOpen onClose={() => {}} addToast={() => {}} />); renderWithConfirm(<WorkflowNodeEditor isOpen onClose={() => {}} addToast={() => {}} />);
await screen.findByText("Save");
await waitFor(() => expect(screen.getAllByLabelText(/Column name/i).length).toBeGreaterThan(0));
// Edit the active workflow. // 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"); const input = await screen.findByTestId("wf-workflow-name-input");
fireEvent.change(input, { target: { value: "Edited" } }); fireEvent.change(input, { target: { value: "Edited" } });
fireEvent.keyDown(input, { key: "Enter" }); fireEvent.keyDown(input, { key: "Enter" });