feat(workbench): integrate operational workflows and map state
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { expect, test, type Page } from "@playwright/test";
|
||||
import { mockScadaApi } from "./support/mock-scada-api";
|
||||
import { mockScadaApi, TEST_PROJECT_ID } from "./support/mock-scada-api";
|
||||
|
||||
test("loads SCADA from the backend API and aligns map features by device_id", async ({ page }) => {
|
||||
await mockRuntimeAndMap(page, { valves: 0, reservoirs: 0, pumps: 0, tanks: 0 });
|
||||
@@ -35,7 +35,7 @@ test("loads SCADA from the backend API and aligns map features by device_id", as
|
||||
await page.goto("/", { waitUntil: "domcontentloaded" });
|
||||
|
||||
const deviceRequest = await deviceRequestPromise;
|
||||
expect(deviceRequest.headers()["x-project-id"]).toBe("project-1");
|
||||
expect(deviceRequest.headers()["x-project-id"]).toBe(TEST_PROJECT_ID);
|
||||
await expect.poll(async () => page.evaluate(() => {
|
||||
const map = globalThis.__waterNetworkMap;
|
||||
if (!map) return [];
|
||||
@@ -131,7 +131,7 @@ test("loads required map layers while optional layer probes are still pending",
|
||||
await expect.poll(() => page.evaluate(() => ({
|
||||
pipes: Boolean(globalThis.__waterNetworkMap?.getLayer("pipes-casing")),
|
||||
pumps: Boolean(globalThis.__waterNetworkMap?.getLayer("pumps-symbol"))
|
||||
}))).toEqual({ pipes: true, pumps: false });
|
||||
})), { timeout: 15_000 }).toEqual({ pipes: true, pumps: false });
|
||||
} finally {
|
||||
releaseProbe();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user