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.
This commit is contained in:
Marc-André Bombeck committed 2026-05-17 23:55:55 +02:00
1 parent 6ea1c77532
commit fa8a62513a
1 file changed
+6
+6
View File
@@ -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,
},