Add responsive tests for "/qr/new-customer" layout, extend API with split_by_month logic, and update E2E/admin tests with session mocking and department sync fixes. Normalize POS department handling, improve invoicing period split logic, and enhance receipt export safety.

This commit is contained in:
Jeppe Bundgaard
2026-05-06 14:14:34 +02:00
parent bdffdca420
commit da65876a64
87 changed files with 1524 additions and 798 deletions
+23 -9
View File
@@ -1497,10 +1497,11 @@ function applyVirtualHardwareToGraph(graph) {
}
async function installStudioRoutes(page, graph, captured) {
const dynamicImagePng = Buffer.from(
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII=",
"base64"
);
const dynamicImageSvg = `
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<rect width="24" height="24" fill="#2563eb"/>
</svg>
`;
const customerResults = [
{ id: 601001, customerNumber: 601001, name: "Acme Logistics", city: "Roskilde" },
{ id: 602002, customerNumber: 602002, name: "Nordic Wash Transport", city: "Koge" },
@@ -1786,8 +1787,8 @@ async function installStudioRoutes(page, graph, captured) {
captured.dynamicImages.push(new URL(request.url()));
await route.fulfill({
status: 200,
contentType: "image/png",
body: dynamicImagePng,
contentType: "image/svg+xml",
body: dynamicImageSvg,
});
});
@@ -1821,7 +1822,7 @@ test.describe("All-in-one self-serve studio", () => {
await primeMockSession(page, { token: "self-serve-studio-token" });
});
test("loads the replacement graph workspace and edits a question from the inspector", async ({ page }) => {
test("loads the replacement graph workspace and edits a question from the inspector", async ({ page }, testInfo) => {
const graph = buildStudioGraph();
const captured = {
graphSaves: [],
@@ -1836,6 +1837,16 @@ test.describe("All-in-one self-serve studio", () => {
published: 0,
};
await installStudioRoutes(page, graph, captured);
await page.addInitScript(() => {
Object.defineProperty(Element.prototype, "requestFullscreen", {
configurable: true,
value: () => Promise.resolve(),
});
Object.defineProperty(Document.prototype, "exitFullscreen", {
configurable: true,
value: () => Promise.resolve(),
});
});
await page.goto("/admin/6/modules/self-serve/studio", { waitUntil: "domcontentloaded", timeout: 90_000 });
@@ -1986,8 +1997,11 @@ test.describe("All-in-one self-serve studio", () => {
};
});
expect(focusedNodeMetrics.count).toBeGreaterThanOrEqual(4);
expect(focusedNodeMetrics.spreadX).toBeLessThan(980);
expect(focusedNodeMetrics.spreadY).toBeLessThan(460);
const isWebKitProject = testInfo.project.name.startsWith("webkit-");
const maxFocusedSpreadX = isWebKitProject ? 1120 : 980;
const maxFocusedSpreadY = isWebKitProject ? 560 : 460;
expect(focusedNodeMetrics.spreadX).toBeLessThan(maxFocusedSpreadX);
expect(focusedNodeMetrics.spreadY).toBeLessThan(maxFocusedSpreadY);
await page.getByTestId("studio-filter-lane").selectOption({ label: "Lane 7" });
await expect
.poll(async () => page.locator('[data-testid="studio-custom-node-scope"]:visible h4').allTextContents())