From fa8a62513a515b11f7f81a0d68aa2183c65b09ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 17 May 2026 23:55:55 +0200 Subject: [PATCH] test(e2e): include unit + source on the mocked measurement row `measurement-flow.spec.ts` mocks `/api/measurements` and echoes the just-posted body back as the list response. The `Measurement` shape the list page consumes requires `unit` and `source`; the mock omitted both, the list render crashed before painting the row, and the test's `expect.poll(...)` for "78.4" timed out. --- e2e/measurement-flow.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/e2e/measurement-flow.spec.ts b/e2e/measurement-flow.spec.ts index 882e296cc..e23e194a3 100644 --- a/e2e/measurement-flow.spec.ts +++ b/e2e/measurement-flow.spec.ts @@ -45,12 +45,18 @@ test.describe("add measurement flow", () => { value?: number; measuredAt?: string; } | null; + // The list-page `Measurement` shape requires `unit` and `source` + // — without them the row crashes the render and the e2e poll + // never sees "78.4". Mock with the same fields a real reading + // carries. const measurements = body ? [ { id: "m_e2e_1", type: body.type, value: body.value, + unit: body.type === "WEIGHT" ? "kg" : "", + source: "MANUAL", measuredAt: body.measuredAt, notes: null, },