From e734c161f44d4179cd8d38050b94e9889c93320c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 7 Jul 2026 21:19:58 +0200 Subject: [PATCH] test(documents): clinician doc list + share picker/QR + i18n x6 --- .../__tests__/clinician-view.test.tsx | 78 ++++++++++++++++++- src/components/clinician/clinician-view.tsx | 7 +- .../__tests__/sharing-section.test.tsx | 26 +++++++ 3 files changed, 106 insertions(+), 5 deletions(-) diff --git a/src/components/clinician/__tests__/clinician-view.test.tsx b/src/components/clinician/__tests__/clinician-view.test.tsx index 74dd4606e..f77f86bab 100644 --- a/src/components/clinician/__tests__/clinician-view.test.tsx +++ b/src/components/clinician/__tests__/clinician-view.test.tsx @@ -5,6 +5,7 @@ * carries the descriptive "not a clinical assessment / not a diagnosis" * disclaimer, the provenance header renders, and the view holds no app chrome. */ +import type React from "react"; import { describe, it, expect } from "vitest"; import { renderToStaticMarkup } from "react-dom/server"; @@ -59,7 +60,15 @@ function makeReport( } as DoctorReportData; } -function render(report: DoctorReportData) { +function render( + report: DoctorReportData, + extra?: Partial< + Pick< + React.ComponentProps, + "documents" | "token" | "locale" + > + >, +) { const { t } = getServerTranslator("en"); return renderToStaticMarkup( , ); } @@ -107,4 +117,70 @@ describe("", () => { expect(html).not.toContain('data-slot="sidebar"'); expect(html).not.toContain("coach"); }); + + it("renders no document section when the frozen set is empty", () => { + const html = render(makeReport(), { documents: [], token: "hls_abc" }); + expect(html).not.toContain("Documents"); + }); + + it("renders Class A inline: image → , PDF →