From b975e86b390ae10d1fbe5294a6ee72085142a1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 3 Nov 2026 22:39:16 +0100 Subject: [PATCH] test(clinician-share): start every case on an all-modules-on map Two cases switch the doctor report off for the rest of their block, and the blocks that did not set the map themselves inherited it under a shuffled order, so a record share stopped aggregating. --- src/lib/clinician-share/__tests__/share-view-data.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/clinician-share/__tests__/share-view-data.test.ts b/src/lib/clinician-share/__tests__/share-view-data.test.ts index d4bb99991..a74da03fd 100644 --- a/src/lib/clinician-share/__tests__/share-view-data.test.ts +++ b/src/lib/clinician-share/__tests__/share-view-data.test.ts @@ -80,6 +80,7 @@ function ctx(overrides: Partial = {}): ShareContext { describe("loadShareViewData — KVNR default OFF", () => { beforeEach(() => { vi.clearAllMocks(); + moduleMap.mockReset().mockResolvedValue(allModulesOn()); collect.mockResolvedValue({ patient: { displayName: "Shared record" }, }); @@ -216,6 +217,7 @@ describe("loadShareViewData — KVNR default OFF", () => { describe("loadShareViewData — documents-only share exposes no health data", () => { beforeEach(() => { vi.clearAllMocks(); + moduleMap.mockReset().mockResolvedValue(allModulesOn()); collect.mockResolvedValue({ patient: { displayName: "Shared record" } }); findDocs.mockResolvedValue([]); }); @@ -296,6 +298,7 @@ describe("loadShareViewData — documents-only share exposes no health data", () describe("loadShareViewData — documentOnly column is authoritative", () => { beforeEach(() => { vi.clearAllMocks(); + moduleMap.mockReset().mockResolvedValue(allModulesOn()); collect.mockResolvedValue({ patient: { displayName: "Shared record" } }); findDocs.mockResolvedValue([]); }); @@ -339,6 +342,7 @@ describe("loadShareViewData — documentOnly column is authoritative", () => { describe("loadShareViewData — the frozen scope reaches the aggregator intact", () => { beforeEach(() => { vi.clearAllMocks(); + moduleMap.mockReset().mockResolvedValue(allModulesOn()); collect.mockResolvedValue({ patient: { displayName: "Shared record" } }); findDocs.mockResolvedValue([]); });