Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: improve e2e organization test #15775

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 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
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
13 changes: 10 additions & 3 deletions site/e2e/tests/organizations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,27 @@ test("create and delete organization", async ({ page }) => {
waitUntil: "domcontentloaded",
});

await page.getByLabel("Slug", { exact: true }).fill("floop");
await page.getByLabel("Slug").fill("floop");
await page.getByLabel("Display name").fill("Floop");
await page.getByLabel("Description").fill("Org description floop");
await page.getByLabel("Icon", { exact: true }).fill("/emojis/1f957.png");

await page.getByRole("button", { name: "Submit" }).click();

// Expect to be redirected to the new organization
await expectUrl(page).toHavePathName("/organizations/floop");
await expect(page.getByText("Organization created.")).toBeVisible();

await page.getByLabel("Slug").fill("wibble");
await page.getByLabel("Description").fill("Org description wibble");
await page.getByRole("button", { name: "Submit" }).click();

// Expect to be redirected when renaming the organization
await expectUrl(page).toHavePathName("/organizations/wibble");
await expect(page.getByText("Organization settings updated.")).toBeVisible();

await page.getByRole("button", { name: "Delete this organization" }).click();
const dialog = page.getByTestId("dialog");
await dialog.getByLabel("Name").fill("floop");
await dialog.getByLabel("Name").fill("wibble");
await dialog.getByRole("button", { name: "Delete" }).click();
await expect(page.getByText("Organization deleted.")).toBeVisible();
});
Loading