Skip to content

chore: replace MoreMenu with DropdownMenu #17615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 1, 2025
Prev Previous commit
Next Next commit
fix: fix test
  • Loading branch information
jaaydenh committed May 1, 2025
commit e13f22469ebab66dce1fe04033d1bd5022928011
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ const renderPage = async () => {

const removeMember = async () => {
const user = userEvent.setup();
// Click on the "More options" button to display the "Remove" option
const moreButtons = await screen.findAllByLabelText("More options");
// Click on the "Open menu" button to display the "Remove" option
const menuButtons = await screen.findAllByLabelText("Open menu");
// get MockUser2
const selectedMoreButton = moreButtons[0];
const selectedMenuButton = menuButtons[0];

await user.click(selectedMoreButton);
await user.click(selectedMenuButton);

const removeButton = screen.getByText(/Remove/);
const removeButton = await within(document.body).findByText("Remove…");
await user.click(removeButton);

const dialog = await within(document.body).findByRole("dialog");
Expand Down
8 changes: 6 additions & 2 deletions site/src/pages/UsersPage/UsersPage.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,9 @@ export const ResetUserPasswordSuccess: Story = {
spyOn(API, "updateUserPassword").mockResolvedValue();

await user.click(within(userRow).getByLabelText("Open menu"));
const resetPasswordButton = await within(document.body).findByText("Reset password…");
const resetPasswordButton = await within(document.body).findByText(
"Reset password…",
);
await user.click(resetPasswordButton);

const dialog = await within(document.body).findByRole("dialog");
Expand All @@ -292,7 +294,9 @@ export const ResetUserPasswordError: Story = {
spyOn(API, "updateUserPassword").mockRejectedValue({});

await user.click(within(userRow).getByLabelText("Open menu"));
const resetPasswordButton = await within(document.body).findByText("Reset password…");
const resetPasswordButton = await within(document.body).findByText(
"Reset password…",
);
await user.click(resetPasswordButton);

const dialog = await within(document.body).findByRole("dialog");
Expand Down