Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+32
-33
@@ -1,14 +1,19 @@
|
||||
import { expect, test } from "./utils/test";
|
||||
import { expectNoCriticalA11yViolations } from "./utils/axe";
|
||||
import { getTenantCredentials, loginAsTenantUser, tenantRolesAndPermissionsPath } from "./utils/auth";
|
||||
import { getTenantCredentials, loginAsTenantUser, tenantRolesAndPermissionsPath, tenantSettingsMembersPath } from "./utils/auth";
|
||||
import { compactMobileViewport, expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
|
||||
import { escapeRegExp, interceptCurrentRoutePost, postDataIncludesField, skipIfUnavailable } from "./utils/navigation";
|
||||
import { skipOrFailWhenE2eFixtureMissing, skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
|
||||
|
||||
// R-P2b (D-P2 Admin RBAC): one merged "Rollen und Berechtigungen" tab (S02);
|
||||
// role assignment happens inline in the members list (D01 dropdown) instead of
|
||||
// the old users matrix (route redirects to settings/members).
|
||||
|
||||
const credentials = getTenantCredentials();
|
||||
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
|
||||
const rolesAndPermissionsPath =
|
||||
process.env.E2E_TENANT_ROLES_AND_PERMISSIONS_PATH ?? (dashboardPath ? tenantRolesAndPermissionsPath(dashboardPath) : undefined);
|
||||
const membersPath = process.env.E2E_TENANT_MEMBERS_PATH ?? (dashboardPath ? tenantSettingsMembersPath(dashboardPath) : undefined);
|
||||
|
||||
test.describe("tenant roles and permissions mobile a11y", () => {
|
||||
test.use({ isMobile: true, hasTouch: true });
|
||||
@@ -24,35 +29,21 @@ test.describe("tenant roles and permissions mobile a11y", () => {
|
||||
});
|
||||
|
||||
for (const viewport of [narrowMobileViewport, compactMobileViewport]) {
|
||||
test(`keeps users, roles, and permissions usable at ${viewport.width}px`, async ({ page }) => {
|
||||
test(`keeps the merged roles tab usable at ${viewport.width}px`, async ({ page }) => {
|
||||
await page.setViewportSize(viewport);
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const response = await page.goto(rolesAndPermissionsPath!, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant roles and permissions path ${rolesAndPermissionsPath}`);
|
||||
|
||||
const usersPath = `${rolesAndPermissionsPath}/users`;
|
||||
const rolesPath = `${rolesAndPermissionsPath}/roles`;
|
||||
const permissionsPath = `${rolesAndPermissionsPath}/permissions`;
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(usersPath)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.tabs"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users"] table').first()).toBeVisible();
|
||||
|
||||
const firstRoleToggle = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users.roleToggle"]').first();
|
||||
if ((await firstRoleToggle.count()) > 0) {
|
||||
await expect(firstRoleToggle).toHaveAccessibleName(/assign|unassign|zuweisen|entziehen/i);
|
||||
}
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
// The tab bar collapses to a <select> below md (TabsVertical), so the tab
|
||||
// <a> links are hidden on mobile. Navigate the sub-pages directly to verify
|
||||
// each is usable at this viewport (what this test asserts).
|
||||
await page.goto(rolesPath, { waitUntil: "domcontentloaded" });
|
||||
// Index redirects into the merged S02 roles tab.
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(rolesPath)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.page"]').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles"] table').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.filter"]').first()).toBeVisible();
|
||||
|
||||
// The "new role" control is permission-gated and may not render for this
|
||||
// fixture; assert it only when present (matches the desktop spec's scope).
|
||||
const rolesNew = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.roles.new"]').first();
|
||||
@@ -62,31 +53,39 @@ test.describe("tenant roles and permissions mobile a11y", () => {
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
|
||||
await page.goto(permissionsPath, { waitUntil: "domcontentloaded" });
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(permissionsPath)}(?:[?#].*)?$`, "u"));
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.permissions"] table').first()).toBeVisible();
|
||||
await expect(page.locator('[data-ui-id="ui.settings.rolesAndPermissions.permissions.table"]').first()).toBeVisible();
|
||||
// Legacy permissions sub-tab redirects into the merged roles tab.
|
||||
await page.goto(`${rolesAndPermissionsPath}/permissions`, { waitUntil: "domcontentloaded" });
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(rolesPath)}(?:[?#].*)?$`, "u"));
|
||||
await expectNoHorizontalOverflow(page);
|
||||
await expectNoCriticalA11yViolations(page);
|
||||
});
|
||||
}
|
||||
|
||||
test("submits the mobile role toggle contract without mutating fixture data", async ({ page }) => {
|
||||
test("submits the inline role toggle contract (D01) without mutating fixture data", async ({ page }) => {
|
||||
await page.setViewportSize(narrowMobileViewport);
|
||||
await loginAsTenantUser(page, credentials!);
|
||||
|
||||
const usersPath = `${rolesAndPermissionsPath}/users`;
|
||||
const response = await page.goto(usersPath, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant roles and permissions users path ${usersPath}`);
|
||||
if (!membersPath) {
|
||||
skipOrFailWhenE2eFixtureMissing("Tenant members path could not be derived; set E2E_TENANT_MEMBERS_PATH");
|
||||
}
|
||||
// The old users matrix redirects to the members list; D01 lives there now.
|
||||
const response = await page.goto(`${rolesAndPermissionsPath}/users`, { waitUntil: "domcontentloaded" });
|
||||
await skipIfUnavailable(page, response, `Tenant roles users path ${rolesAndPermissionsPath}/users`);
|
||||
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(membersPath!)}(?:[?#].*)?$`, "u"));
|
||||
|
||||
const roleToggle = page.locator('[data-ui-id="ui.settings.rolesAndPermissions.users.roleToggle"]:not([disabled])').first();
|
||||
if ((await roleToggle.count()) === 0 || !(await roleToggle.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Tenant roles fixture has no enabled role toggle for mobile contract coverage");
|
||||
const roleDropdown = page.locator('[data-ui-id="ui.settings.members.roleDropdown"]').first();
|
||||
if ((await roleDropdown.count()) === 0 || !(await roleDropdown.isVisible())) {
|
||||
skipOrFailWhenE2eFixtureMissing("Tenant members fixture has no editable role dropdown for mobile contract coverage");
|
||||
}
|
||||
await roleDropdown.tap();
|
||||
|
||||
const roleCheckbox = page.getByRole("checkbox").first();
|
||||
if ((await roleCheckbox.count()) === 0) {
|
||||
skipOrFailWhenE2eFixtureMissing("Tenant members fixture exposes no assignable roles for mobile contract coverage");
|
||||
}
|
||||
|
||||
await expect(roleToggle).toHaveAccessibleName(/assign|unassign|zuweisen|entziehen/i);
|
||||
const submitted = await interceptCurrentRoutePost(page, { status: 204 });
|
||||
await roleToggle.tap();
|
||||
await roleCheckbox.tap();
|
||||
|
||||
await expect.poll(() => submitted.value, { message: "role toggle POST payload was captured" }).not.toBeNull();
|
||||
expect(postDataIncludesField(submitted.value, "action", /^edit$/u)).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user