Track HiveGrid Cloud planning reference

This commit is contained in:
david committed 2026-06-26 20:48:01 +02:00
1 parent b3d5ea6764
commit e341c5938a
5784 files changed
+1104929 -3

No files matched your search

@@ -0,0 +1,39 @@
import { expect, test } from "./utils/test";
import { expectNoCriticalA11yViolations } from "./utils/axe";
import { getTenantCredentials, loginAsTenantUser } from "./utils/auth";
import { expectNoHorizontalOverflow, narrowMobileViewport } from "./utils/mobile";
import { escapeRegExp, skipIfUnavailable } from "./utils/navigation";
import { skipOrFailWhenE2eInputsMissing } from "./utils/readiness";
const credentials = getTenantCredentials();
const dashboardPath = process.env.E2E_TENANT_DASHBOARD_PATH;
const aiUsagePath = process.env.E2E_TENANT_AI_USAGE_PATH ?? deriveAiUsagePath(dashboardPath);
test.describe("tenant AI usage mobile a11y", () => {
test.use({ viewport: narrowMobileViewport, isMobile: true, hasTouch: true });
test.beforeEach(() => {
skipOrFailWhenE2eInputsMissing(["E2E_TENANT_EMAIL", "E2E_TENANT_PASSWORD", "E2E_TENANT_DASHBOARD_PATH"], "Tenant AI usage E2E inputs not configured");
});
test("renders quota and forecast without mobile overflow or critical a11y violations", async ({ page }) => {
await loginAsTenantUser(page, credentials!);
const response = await page.goto(aiUsagePath!, { waitUntil: "domcontentloaded" });
await skipIfUnavailable(page, response, `Tenant AI usage path ${aiUsagePath}`);
await expect(page).toHaveURL(new RegExp(`${escapeRegExp(aiUsagePath!)}(?:[?#].*)?$`, "u"));
await expect(page.locator("main").first()).toBeVisible();
await expect(page.getByRole("progressbar", { name: /AI quota usage|KI.*Nutzung/i })).toBeVisible();
await expect(page.getByRole("heading", { name: /End-of-month forecast|Prognose/i })).toBeVisible();
await expectNoHorizontalOverflow(page);
await expectNoCriticalA11yViolations(page);
});
});
function deriveAiUsagePath(path: string | undefined): string | undefined {
if (!path) return undefined;
const normalized = path.startsWith("/") ? path : `/${path}`;
return normalized.endsWith("/dashboard") ? normalized.replace(/\/dashboard$/u, "/settings/ai-usage") : undefined;
}