From 419d47c8629e4b424f78d27897c8405950233a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 23 Oct 2026 16:15:36 +0200 Subject: [PATCH] test(e2e): hand the shared account back on the default vault layout The layout journey left the shared account on the stacked arrangement, and the month-grid tests that read the default flowing one failed whenever they ran after it. --- e2e/v142-qol.spec.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/e2e/v142-qol.spec.ts b/e2e/v142-qol.spec.ts index a252891b7..c4bee695c 100644 --- a/e2e/v142-qol.spec.ts +++ b/e2e/v142-qol.spec.ts @@ -22,13 +22,28 @@ import { mockPopulatedInsights } from "./utils/mock-populated-insights"; test.use({ storageState: STORAGE_STATE_PATH }); -async function resetDocumentsLayout(page: Page): Promise { +async function putDocumentsLayout( + page: Page, + arrangement: "stacked" | "flow", +): Promise { const res = await page.request.put("/api/documents/inbound/layout", { - data: { version: 1, view: "cards", arrangement: "stacked" }, + data: { version: 1, view: "cards", arrangement }, }); expect(res.status()).toBe(200); } +/** The journey starts from the stacked arrangement so the flip is visible. */ +const resetDocumentsLayout = (page: Page) => + putDocumentsLayout(page, "stacked"); + +/** + * The account is shared with `documents.spec.ts`, which reads the default + * (flowing) arrangement, so the journey hands the account back on the + * default rather than on the state it started from. + */ +const restoreDefaultDocumentsLayout = (page: Page) => + putDocumentsLayout(page, "flow"); + test.describe("documents", () => { test.beforeAll(async () => { await ensureVaultFixture(); @@ -87,7 +102,7 @@ test.describe("documents", () => { ).toHaveAttribute("data-arrangement", "flow"); await second.close(); } finally { - await resetDocumentsLayout(page); + await restoreDefaultDocumentsLayout(page); } });