test(apple-health): order the own-sample rows deterministically

Rows of one type came back in insertion order only by chance, so the
three-weight case failed intermittently. Sort by type, time and value.
This commit is contained in:
Marc-André Bombeck committed 2026-10-21 16:25:25 +02:00
1 parent 8e2e4f658b
commit bfb8711f1d
1 file changed
+2 -2
@@ -190,7 +190,7 @@ describe("blood pressure correlations and self-closing records", () => {
source: "APPLE_HEALTH",
type: { in: ["BLOOD_PRESSURE_SYS", "BLOOD_PRESSURE_DIA"] },
},
orderBy: [{ type: "asc" }],
orderBy: [{ type: "asc" }, { measuredAt: "asc" }, { value: "asc" }],
});
return { result, values: rows.map((r) => r.value) };
}
@@ -479,7 +479,7 @@ describe("a sample whose HKExternalUUID is a HealthLog row id", () => {
});
const rows = await prisma.measurement.findMany({
where: { userId: user.id, source: "APPLE_HEALTH" },
orderBy: [{ type: "asc" }],
orderBy: [{ type: "asc" }, { measuredAt: "asc" }, { value: "asc" }],
});
return { result, rows };
}