test(ui): cover redesigned journeys and responsive shell

This commit is contained in:
NuklearRabbit
2026-08-02 03:27:30 +02:00
parent fd9b25c25c
commit b3946af4e0
3 changed files with 71 additions and 15 deletions
+9 -8
View File
@@ -17,16 +17,17 @@ test.beforeEach(async ({ page }) => {
test("all seven nav items navigate correctly", async ({ page }) => {
const items: [string, RegExp][] = [
["Dashboard", /\/dashboard$/],
["Vehicles", /\/vehicles$/],
["Overview", /\/dashboard$/],
["Fleet", /\/vehicles$/],
["Bookings", /\/bookings$/],
["Data Quality", /\/data-quality$/],
["Data quality", /\/data-quality$/],
["Knowledge", /\/knowledge$/],
["Automation", /\/automation$/],
["Audit", /\/audit$/],
["Integrations", /\/automation$/],
["Audit trail", /\/audit$/],
];
const primaryNavigation = page.getByRole("navigation", { name: "Primary navigation" });
for (const [label, urlPattern] of items) {
await page.getByRole("link", { name: label }).click();
await primaryNavigation.getByRole("link", { name: label, exact: true }).click();
await expect(page).toHaveURL(urlPattern);
}
});
@@ -123,7 +124,7 @@ test("audit page: action filter works", async ({ page }) => {
await page.getByLabel("Action").fill("demo_login");
await expect(page.locator(".data-table tbody tr").first()).toBeVisible();
const actions = await page.locator(".data-table tbody tr td:nth-child(3)").allTextContents();
expect(actions.every((a) => a.includes("demo_login"))).toBeTruthy();
expect(actions.every((a) => a.includes("demo login"))).toBeTruthy();
});
test("knowledge page: form submits and clears input", async ({ page }) => {
@@ -146,7 +147,7 @@ test("rental employee role sees restricted automation page and cannot access res
await page.getByRole("button", { name: "Switch role" }).click();
await page.getByRole("button", { name: "Open as Rental Employee" }).click();
await expect(page).toHaveURL(/\/dashboard$/);
await page.getByRole("link", { name: "Automation" }).click();
await page.getByRole("link", { name: "Integrations" }).click();
await expect(
page.getByText("Automation delivery status is visible to Operations Managers only."),
).toBeVisible();