diff --git a/tests/integration/dense-targets-reads.test.ts b/tests/integration/dense-targets-reads.test.ts index e3a4a2aae..5cad59b59 100644 --- a/tests/integration/dense-targets-reads.test.ts +++ b/tests/integration/dense-targets-reads.test.ts @@ -242,7 +242,14 @@ describe("targets fold equals the raw-reading fold", () => { ); expect(glucose.length).toBe(expectedGlucose.length); for (let i = 0; i < glucose.length; i++) { - const { average30, ...rest } = glucose[i]; + // The direction verdict is resolved by the route on top of the card + // (v1.43); the fold under comparison does not produce it. + const { + average30, + direction: _direction, + trendSentiment: _trendSentiment, + ...rest + } = glucose[i]; const { average30: expAvg, ...expRest } = expectedGlucose[i]; expect(rest).toEqual(expRest); if (expAvg === null) expect(average30).toBeNull(); @@ -275,8 +282,14 @@ describe("targets fold equals the raw-reading fold", () => { now, weightTargetOverride: null, }).targets.find((t) => t.type === "PULSE"); - const pulse = res.targets.find((t) => t.type === "PULSE"); - expect(pulse?.current).not.toBeNull(); + const pulseTarget = res.targets.find((t) => t.type === "PULSE"); + expect(pulseTarget?.current).not.toBeNull(); + expect(pulseTarget?.direction).toBeDefined(); + const { + direction: _direction, + trendSentiment: _trendSentiment, + ...pulse + } = pulseTarget!; expect(pulse).toEqual(expectedPulse); }); } diff --git a/tests/integration/timezone-per-user.test.ts b/tests/integration/timezone-per-user.test.ts index 218764d21..0adf6a6a2 100644 --- a/tests/integration/timezone-per-user.test.ts +++ b/tests/integration/timezone-per-user.test.ts @@ -213,7 +213,11 @@ describe("per-user timezone — Pacific/Auckland end-to-end", () => { data: { glucoseUnit: string | null; features: Record }; }; expect(body.data.glucoseUnit).toBe("mmol/L"); - expect(body.data.features).toEqual({ trackIntake: true }); + // The flag set grows with each release; every flag is a plain boolean. + expect(body.data.features).toMatchObject({ trackIntake: true }); + expect( + Object.values(body.data.features).every((v) => typeof v === "boolean"), + ).toBe(true); await prisma.user.update({ where: { id: user.id },