mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add e2e tests for template permissions (#12731)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import {
|
||||
createGroup,
|
||||
createTemplate,
|
||||
requiresEnterpriseLicense,
|
||||
updateTemplateSettings,
|
||||
@@ -15,6 +16,32 @@ test("template update with new name redirects on successful submit", async ({
|
||||
});
|
||||
});
|
||||
|
||||
test("add and remove a group", async ({ page }) => {
|
||||
requiresEnterpriseLicense();
|
||||
|
||||
const templateName = await createTemplate(page);
|
||||
const groupName = await createGroup(page);
|
||||
|
||||
await page.goto(`/templates/${templateName}/settings/permissions`, {
|
||||
waitUntil: "domcontentloaded",
|
||||
});
|
||||
await expect(page).toHaveURL(
|
||||
`/templates/${templateName}/settings/permissions`,
|
||||
);
|
||||
|
||||
// Type the first half of the group name
|
||||
await page
|
||||
.getByPlaceholder("Search for user or group", { exact: true })
|
||||
.fill(groupName.slice(0, 4));
|
||||
|
||||
// Select the group from the list and add it
|
||||
await page.getByText(groupName).click();
|
||||
await page.getByText("Add member").click();
|
||||
await expect(
|
||||
page.locator(".MuiTable-root").getByText(groupName),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test("require latest version", async ({ page }) => {
|
||||
requiresEnterpriseLicense();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user