mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
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:
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 };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user