Skip to content

Commit 359aa7b

Browse files
committed
fix: fix test
1 parent fab18b0 commit 359aa7b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

site/src/pages/OrganizationSettingsPage/OrganizationMembersPage.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ const renderPage = async () => {
4646

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

54-
await user.click(selectedMoreButton);
54+
await user.click(selectedMenuButton);
5555

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

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

site/src/pages/UsersPage/UsersPage.stories.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ export const ResetUserPasswordSuccess: Story = {
268268
spyOn(API, "updateUserPassword").mockResolvedValue();
269269

270270
await user.click(within(userRow).getByLabelText("Open menu"));
271-
const resetPasswordButton = await within(document.body).findByText("Reset password…");
271+
const resetPasswordButton = await within(document.body).findByText(
272+
"Reset password…",
273+
);
272274
await user.click(resetPasswordButton);
273275

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

294296
await user.click(within(userRow).getByLabelText("Open menu"));
295-
const resetPasswordButton = await within(document.body).findByText("Reset password…");
297+
const resetPasswordButton = await within(document.body).findByText(
298+
"Reset password…",
299+
);
296300
await user.click(resetPasswordButton);
297301

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

0 commit comments

Comments
 (0)