mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
test(nutrients): pin that the batch still refuses the supplement-only codes
This commit is contained in:
1 parent
a2db048a4d
commit
fe687b0870
1 file changed
+12
@@ -300,3 +300,15 @@ describe("upper intake levels (v1.43)", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("the batch contract stays the syncable codes (v1.43)", () => {
|
||||
it("refuses dha and epa in the HealthKit batch and accepts a syncable code", async () => {
|
||||
const { nutrientBatchSchema } = await import("@/lib/validations/nutrients");
|
||||
const entry = (nutrient: string) => ({
|
||||
entries: [{ day: "2026-07-10", nutrient, unit: "mg", amount: 100 }],
|
||||
});
|
||||
expect(nutrientBatchSchema.safeParse(entry("dha")).success).toBe(false);
|
||||
expect(nutrientBatchSchema.safeParse(entry("epa")).success).toBe(false);
|
||||
expect(nutrientBatchSchema.safeParse(entry("magnesium")).success).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user