Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
46350ba
test: wrap interactions that update state with act wrapper
Parsium Dec 9, 2024
c37a61a
chore: upgrade storybook packages to 8.4.7
Parsium Nov 25, 2024
3d495ec
feat: upgrade `react-dnd` and `react-dnd-html5-backend` to v16
Parsium Nov 28, 2024
b0dcfba
feat(menu): let browser handle tabbing to prevent focus on non-focusa…
Parsium Feb 21, 2025
bac91b2
feat: introduce support for react v18
Parsium Dec 9, 2024
fad5723
feat(portrait): add `data-element` and `data-role` props for testing …
Parsium Jan 22, 2025
5c1a4e0
refactor: replace playwright wrapper with react 18 counterpart
Parsium Nov 13, 2024
30581d7
feat: update @tanstack/react-virtual to version ^3.11.2
Parsium Jan 16, 2025
2e5ba55
test(select): use of aria-activedescendent for updating assistive tec…
Parsium Jan 16, 2025
112ed5e
fix(select): debounce scroll handler on option list to reduce frequen…
Parsium Jan 16, 2025
0c29a02
test(select): ensure mousedown tests adequately wait for input to be …
Parsium Jan 17, 2025
001ef80
build: enforce linting rule to disallow React v18 features
Parsium Jan 23, 2025
a908c33
test(menu-item): refactor existing focus tests
Parsium Jan 27, 2025
5e2119e
fix(menu): ensure focus state remains consistent between tabbing and …
Parsium Jan 27, 2025
f086303
fix(menu-item): prevent root element from being focused when containi…
Parsium Feb 7, 2025
bd5f12e
test(menu): ensure all MenuItems in tests are focusable
Parsium Feb 10, 2025
3f5087f
docs(menu): add disclaimer regarding ensuring MenuItems are focusable
Parsium Feb 10, 2025
803b09d
refactor(menu): remove click away listener in favour of submenu blur …
Parsium Feb 10, 2025
824115f
feat(menu): skip non-focusable submenu items when moving focus with U…
Parsium Feb 11, 2025
7238ab1
test(date): improve robustness of flaky test
Parsium Feb 11, 2025
db8f54c
feat(menu): prevent showing hover styling for non-focusable menu items
Parsium Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: wrap interactions that update state with act wrapper
in preparation for consuming latest version of React Testing Library
and its sibling packages
  • Loading branch information
Parsium committed Feb 24, 2025
commit 46350baf963282983bec96386f027091738b5017
21 changes: 18 additions & 3 deletions src/components/tabs/tabs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1719,9 +1719,14 @@ describe("check events for Tabs component", () => {
</Tab>
</Tabs>,
);

const tab2 = screen.getByRole("tab", { name: "Test 2" });
tab2.focus();
act(() => {
tab2.focus();
});

await user.keyboard("{Enter}");

expect(onTabChange).toHaveBeenCalledWith("2");
});
});
Expand Down Expand Up @@ -1757,9 +1762,14 @@ describe("check events for Tabs component", () => {
</Tab>
</Tabs>,
);

const tab2 = screen.getByRole("tab", { name: "Test 2" });
tab2.focus();
act(() => {
tab2.focus();
});

await user.keyboard("{Enter}");

expect(onTabChange).toHaveBeenCalledWith("2");
});
});
Expand Down Expand Up @@ -1807,9 +1817,14 @@ describe("check events for Tabs component", () => {
drawer content
</Drawer>,
);

const tab2 = screen.getByRole("tab", { name: "Test 2" });
tab2.focus();
act(() => {
tab2.focus();
});

await user.keyboard("{Enter}");

expect(onTabChange).toHaveBeenCalledWith("2");
});
});
Expand Down
10 changes: 7 additions & 3 deletions src/components/vertical-menu/vertical-menu.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { render, screen, act } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

import {
Expand Down Expand Up @@ -174,7 +174,9 @@ describe("VerticalMenu", () => {
</>,
);
const closeBtn = screen.getByRole("button");
closeBtn.focus();
act(() => {
closeBtn.focus();
});
await user.keyboard("{Space}");
expect(setMockState).toHaveBeenCalledWith(false);
});
Expand All @@ -195,7 +197,9 @@ describe("VerticalMenu", () => {
</>,
);
const closeBtn = screen.getByRole("button");
closeBtn.focus();
act(() => {
closeBtn.focus();
});
await user.keyboard("{enter}");
expect(setMockState).toHaveBeenCalledWith(false);
});
Expand Down