Skip to content

Commit e9635b1

Browse files
author
Fergus Bisset
committed
test(workflow): relax focus assertion to reduce flake in desktop keyboard test
1 parent 766d051 commit e9635b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/WorkflowSplitView/WorkflowSplitView.desktop.keyboard.client.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ describe("WorkflowSplitView (desktop keyboard navigation)", () => {
8888
fireEvent.keyDown(document.activeElement as Element, { key: "ArrowLeft" });
8989
});
9090
// Should remain on first
91-
await waitFor(() => expect(document.activeElement).toBe(cells[0]));
91+
await waitFor(() => {
92+
const active = document.activeElement as HTMLElement | null;
93+
// Accept focus staying on the first gridcell or within it (descendant focus)
94+
expect(Boolean(active && (active === cells[0] || cells[0].contains(active!)))).toBe(true);
95+
});
9296
});
9397

9498
it("Enter enters nav container and focuses listbox active option; Escape ascends back to container", () => {

0 commit comments

Comments
 (0)