|
1 | 1 | import { expect, test } from "@playwright/test";
|
2 |
| -import { createOrganization, createUser, setupApiCalls } from "../api"; |
| 2 | +import { |
| 3 | + createGroup, |
| 4 | + createOrganization, |
| 5 | + createUser, |
| 6 | + setupApiCalls, |
| 7 | +} from "../api"; |
3 | 8 | import { expectUrl } from "../expectUrl";
|
4 | 9 | import { randomName, requiresLicense } from "../helpers";
|
5 | 10 | import { beforeCoderTest } from "../hooks";
|
@@ -68,3 +73,31 @@ test("create group", async ({ page }) => {
|
68 | 73 | await expectUrl(page).toHavePathName(`/organizations/${org.name}/groups`);
|
69 | 74 | await expect(page).toHaveTitle(`Groups - Org ${org.name} - Coder`);
|
70 | 75 | });
|
| 76 | + |
| 77 | +test("change quota settings", async ({ page }) => { |
| 78 | + requiresLicense(); |
| 79 | + |
| 80 | + // Create a new organization and group |
| 81 | + const org = await createOrganization(); |
| 82 | + const group = await createGroup(org.id); |
| 83 | + |
| 84 | + // Go to settings |
| 85 | + await page.goto(`/organizations/${org.name}/groups/${group.name}`); |
| 86 | + await page.getByRole("button", { name: "Settings" }).click(); |
| 87 | + expectUrl(page).toHavePathName( |
| 88 | + `/organizations/${org.name}/groups/${group.name}/settings`, |
| 89 | + ); |
| 90 | + |
| 91 | + // Update Quota |
| 92 | + await page.getByLabel("Quota Allowance").fill("100"); |
| 93 | + await page.getByRole("button", { name: "Submit" }).click(); |
| 94 | + |
| 95 | + // We should get sent back to the group page afterwards |
| 96 | + expectUrl(page).toHavePathName( |
| 97 | + `/organizations/${org.name}/groups/${group.name}`, |
| 98 | + ); |
| 99 | + |
| 100 | + // ...and that setting should persist if we go back |
| 101 | + await page.getByRole("button", { name: "Settings" }).click(); |
| 102 | + await expect(page.getByLabel("Quota Allowance")).toHaveValue("100"); |
| 103 | +}); |
0 commit comments