mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: improve e2e organization test (#15775)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user