mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
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:
1 parent
6ea1c77532
commit
fa8a62513a
1 file changed
+6
@@ -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,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user