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
Show file tree
Hide file tree
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
Next Next commit
[_screaming intensifies_]
  • Loading branch information
aslilac committed Dec 11, 2024
commit d4fd10a6006efab061bc56bf8089502e40e5873c
16 changes: 6 additions & 10 deletions site/e2e/tests/organizationMembers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.beforeEach(async ({ page }) => {
await setupApiCalls(page);
});

test("create and delete organization", async ({ page }) => {
test("add and remove organization member", async ({ page }) => {
requiresLicense();

// Create a new organization to test
Expand All @@ -36,19 +36,15 @@ test("create and delete organization", async ({ page }) => {

// Give them a role
await addedRow.getByLabel("Edit user roles").click();
await page.getByRole("checkbox", { name: "Organization admin" }).click();
// await addedRow.getByLabel("Edit user roles").click();
await expect(addedRow.getByText("Organization admin")).toBeVisible();
await page.getByText("Organization User Admin").click();
await page.getByText("Organization Template Admin").click();
await page.mouse.click(10, 10); // close the popover by clicking outside of it
await expect(addedRow.getByText("Organization User Admin")).toBeVisible();
await expect(addedRow.getByText("+1 more")).toBeVisible();

// Remove them from the org
await addedRow.getByLabel("More options").click();
await page.getByText("Remove").click(); // Click the "Remove" option
await page.getByRole("button", { name: "Remove" }).click(); // Click "Remove" in the confirmation dialog
await expect(addedRow).not.toBeVisible();

// await page.getByRole("button", { name: "Delete this organization" }).click();
// const dialog = page.getByTestId("dialog");
// await dialog.getByLabel("Name").fill(newName);
// await dialog.getByRole("button", { name: "Delete" }).click();
// await expect(page.getByText("Organization deleted.")).toBeVisible();
});
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const EditRolesButton: FC<EditRolesButtonProps> = ({
</Tooltip>
</PopoverTrigger>

<PopoverContent classes={{ paper }}>
<PopoverContent classes={{ paper }} disablePortal={false}>
<fieldset
css={styles.fieldset}
disabled={isLoading}
Expand Down
Loading