Skip to content

chore: add e2e tests for organization members #15807

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 9 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
fix userspage tests
  • Loading branch information
aslilac committed Dec 11, 2024
commit fe0d4ae6976b26a4353e76097fc83198e85c6224
16 changes: 5 additions & 11 deletions site/src/pages/UsersPage/UsersPage.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react";
import { spyOn, userEvent, within } from "@storybook/test";
import { screen, spyOn, userEvent, within } from "@storybook/test";
import { API } from "api/api";
import { deploymentConfigQueryKey } from "api/queries/deployment";
import { groupsQueryKey } from "api/queries/groups";
Expand Down Expand Up @@ -368,12 +368,8 @@ export const UpdateUserRoleSuccess: Story = {
});

await user.click(within(userRow).getByLabelText("Edit user roles"));
await user.click(
within(userRow).getByLabelText("Auditor", { exact: false }),
);
await within(document.body).findByText(
"Successfully updated the user roles.",
);
await user.click(screen.getByLabelText("Auditor", { exact: false }));
await screen.findByText("Successfully updated the user roles.");
},
};

Expand All @@ -388,10 +384,8 @@ export const UpdateUserRoleError: Story = {
spyOn(API, "updateUserRoles").mockRejectedValue({});

await user.click(within(userRow).getByLabelText("Edit user roles"));
await user.click(
within(userRow).getByLabelText("Auditor", { exact: false }),
);
await within(document.body).findByText("Error on updating the user roles.");
await user.click(screen.getByLabelText("Auditor", { exact: false }));
await screen.findByText("Error on updating the user roles.");
},
};

Expand Down
Loading