Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/tests/component/va-p26a-customer-portal-interim.ct.tsx
T

48 lines
1.9 KiB
TypeScript

import { expect, test } from "@playwright/experimental-ct-react";
import AxeBuilder from "@axe-core/playwright";
import {
CustomerPortalInterimVisualFixture as VisualFixture,
CustomerPortalProjectDetailInterimVisualFixture as ProjectDetailFixture,
} from "../../apps/web/app/components/screens/customer-portal/customer-portal-interim.visual-fixture";
test.describe("VA-P26a customer portal interim UI", () => {
test("access-scoped dashboard stays visually stable in light mode", async ({ mount, page }) => {
const component = await mount(
<div data-testid="va-p26a-customer-portal-dashboard" style={{ width: "1280px", minHeight: "720px" }}>
<VisualFixture />
</div>
);
await page.evaluate(async () => {
await document.fonts.ready;
});
await expect(component.locator('[data-ui-id="ui.customerPortal.portalShell"]')).toHaveCount(1);
await expect(component.locator('[data-ui-id="ui.customerPortal.projectCard"]')).toHaveCount(1);
await expect(component).toContainText("Montagefreigabe.pdf");
await expect(component).toHaveScreenshot("va-p26a-customer-portal-dashboard.png");
});
test("ready project detail meets WCAG 2 A/AA", async ({ mount, page }) => {
const component = await mount(
<div data-testid="va-p26a-customer-portal-project-detail" style={{ width: "1280px", minHeight: "720px" }}>
<ProjectDetailFixture />
</div>
);
await page.evaluate(async () => {
await document.fonts.ready;
});
await expect(component.locator('[data-ui-id="ui.customerPortal.portalShell"]')).toHaveCount(1);
await expect(component.getByRole("progressbar")).toHaveCount(1);
const results = await new AxeBuilder({ page })
.include('[data-ui-id="ui.customerPortal.portalShell"]')
.withTags(["wcag2a", "wcag2aa"])
.analyze();
expect(results.violations).toEqual([]);
});
});