Skip to content

fix: bypass pointer events check during UpdateUserRoleError story#26077

Draft
aqandrew wants to merge 1 commit into
mainfrom
aqandrew/fix-flake-userspage-pointer-events
Draft

fix: bypass pointer events check during UpdateUserRoleError story#26077
aqandrew wants to merge 1 commit into
mainfrom
aqandrew/fix-flake-userspage-pointer-events

Conversation

@aqandrew
Copy link
Copy Markdown
Contributor

@aqandrew aqandrew commented Jun 4, 2026

fixes DEVEX-402

Fixes this test flake when testing UsersPage.stories.tsx locally:

FAIL  |storybook (chromium)| src/pages/UsersPage/UsersPage.stories.tsx > Update User Role Error
Unable to perform pointer interaction as the element has `pointer-events: none`:

BUTTON#radix-_r_163_(label=Open menu)
 ❯ play src/pages/UsersPage/UsersPage.stories.tsx:395:8
    393|   spyOn(API, "updateUserRoles").mockRejectedValue({});
    394|
    395|   await user.click(within(userRow).getByLabelText("Open menu"));
    396|   await user.click(screen.getByText("Edit roles"));
    397|   await user.click(screen.getByLabelText("Auditor", { exact: false }));

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 4, 2026

DEVEX-402

play: async ({ canvasElement }) => {
const user = userEvent.setup();
const user = userEvent.setup({
pointerEventsCheck: PointerEventsCheckLevel.Never,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We modify the pointerEventsCheck option in 2 other places:

// It seems the dropdown component is disabling pointer events, which is
// causing Testing Library to throw an error. As a workaround, we can
// disable the pointer events check.
return userEvent.setup({
pointerEventsCheck: PointerEventsCheckLevel.Never,
});

The latter's comment is essentially the same as the former's but longer. Is a similar comment needed here?

So strange that this flake wasn't present before #24857, or in any of the other stories in this file which click this menu button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant