chore: add e2e tests for template permissions (#12731)

This commit is contained in:
Kayla Washburn-Love
2024-03-29 10:43:23 -06:00
committed by GitHub
parent eeb3d63be6
commit 1d2d008b45
4 changed files with 44 additions and 2 deletions
+27
View File
@@ -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();