- Introduced unit tests for edge gateway workflow helpers, including workflow step resolution, incident action mapping, relay health row formatting, and workspace state merging. - Added new components for advanced operations, configuration panel, context panel, fleet rail, and health summary. - Enhanced gateway management UI with support for advanced actions, fallback operations, relay health visualization, and device binding features.
42 lines
1.7 KiB
JavaScript
42 lines
1.7 KiB
JavaScript
import { expect, test } from "@playwright/test";
|
|
import { mockApi, primeMockSession } from "./support/network.js";
|
|
|
|
async function primeSuperuserSession(page) {
|
|
const token = "superuser-edge-gateway-visual-token";
|
|
await primeMockSession(page, { token });
|
|
}
|
|
|
|
test.describe("Edge gateway visuals", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await mockApi(page, {
|
|
authenticated: true,
|
|
permissions: ["superuser", "user"],
|
|
});
|
|
await primeSuperuserSession(page);
|
|
});
|
|
|
|
test("desktop tabbed hierarchy", async ({ page }, testInfo) => {
|
|
test.skip(!testInfo.project.name.includes("desktop"), "Desktop only");
|
|
|
|
await page.goto("/superuser/gateways");
|
|
|
|
await expect(page.getByTestId("gateway-step-shell-nav")).toContainText("Kategorier");
|
|
await expect(page.getByTestId("gateway-step-assess")).toContainText("Vurder drift");
|
|
await expect(page.getByTestId("gateway-step-configure")).toContainText("Konfigurer lokalt");
|
|
await expect(page.getByTestId("gateway-step-recover")).toContainText("Gendan og vedligehold");
|
|
await expect(page.getByTestId("gateway-detail-header")).toContainText("Situationsbillede");
|
|
await expect(page.getByTestId("gateway-fleet-rail")).toContainText("Vælg en gateway");
|
|
});
|
|
|
|
test("mobile tabbed hierarchy", async ({ page }, testInfo) => {
|
|
test.skip(!testInfo.project.name.includes("mobile"), "Mobile only");
|
|
|
|
await page.goto("/superuser/gateways");
|
|
|
|
await expect(page.getByTestId("gateway-mobile-open-rail")).toBeVisible();
|
|
await expect(page.getByTestId("gateway-step-shell-nav")).toContainText("Kategorier");
|
|
await page.getByTestId("gateway-mobile-open-rail").click();
|
|
await expect(page.getByTestId("gateway-fleet-rail")).toContainText("Vælg en gateway");
|
|
});
|
|
});
|