mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +00:00
test: type the new fixtures instead of casting them to never
The fixtures added with these fixes switched the type checker off with `as never`, which the realism ratchet refuses to see grow. They now carry their types, three webhook mocks needed no cast at all, and the lowered counts, with the targets route's one fewer version stamp, are written back.
This commit is contained in:
1 parent
315c89d229
commit
2af0751b69
10 files changed
+31
-23
No files matched your search
@@ -61,6 +61,7 @@ vi.mock("@/hooks/use-auth", () => ({
|
||||
|
||||
import { I18nProvider } from "@/lib/i18n/context";
|
||||
import { MeasurementList } from "../measurement-list";
|
||||
import type { Measurement } from "../list/list-model";
|
||||
import type { UnitDisplay } from "@/hooks/use-unit-display";
|
||||
import { convertGlucose, toCanonicalMgdl } from "@/lib/glucose";
|
||||
import { getUnitForType } from "@/lib/measurements/unit-map";
|
||||
@@ -150,8 +151,15 @@ describe("the out-of-range sentence", () => {
|
||||
`${key} ${JSON.stringify(params)}`) as unknown as Parameters<
|
||||
typeof outOfRangeMessage
|
||||
>[2];
|
||||
const reading = (type: string, unit: string) =>
|
||||
({ id: "m1", type, value: 1, unit, source: "MANUAL" }) as never;
|
||||
const reading = (type: string, unit: string): Measurement => ({
|
||||
id: "m1",
|
||||
type,
|
||||
value: 1,
|
||||
unit,
|
||||
source: "MANUAL",
|
||||
measuredAt: "2026-11-10T12:00:00.000Z",
|
||||
notes: null,
|
||||
});
|
||||
const shows = (unit: string) => ({
|
||||
rowDisplay: (m: { value: number }) => ({ value: m.value, unit }),
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user