chore: improve e2e organization test (#15775)

This commit is contained in:
ケイラ
2024-12-09 13:29:30 -07:00
committed by GitHub
parent bc4f9a4327
commit 1bac277156
+10 -3
View File
@@ -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();
});