diff --git a/e2e/documents-procedure-filter.spec.ts b/e2e/documents-procedure-filter.spec.ts index f3d8a0450..28f6aa563 100644 --- a/e2e/documents-procedure-filter.spec.ts +++ b/e2e/documents-procedure-filter.spec.ts @@ -89,7 +89,7 @@ test.describe("document vault — procedure filter", () => { const knee = menu.getByRole("menuitemcheckbox", { name: /Knee arthroscopy/, }); - await expect(knee).toContainText("Knee · Left"); + await expect(knee).toContainText("Knee (Left)"); await expect( menu.getByRole("menuitemcheckbox", { name: /Appendectomy/ }), ).toBeVisible(); diff --git a/src/components/documents/__tests__/document-month-grid.test.tsx b/src/components/documents/__tests__/document-month-grid.test.tsx index 360c2bb48..18d3e330f 100644 --- a/src/components/documents/__tests__/document-month-grid.test.tsx +++ b/src/components/documents/__tests__/document-month-grid.test.tsx @@ -62,6 +62,9 @@ describe("columnsForWidth", () => { expect(columnsForWidth(1024 - 48)).toBe(3); // 1440 viewport: the shell caps the container at 1280 minus its gutters. expect(columnsForWidth(1280 - 48)).toBe(4); + // 1440 with the sidebar and the day strip docked: about 1 040 px left, + // still four tiles of about 240 px. + expect(columnsForWidth(1040)).toBe(4); }); it("never asks for a fifth column", () => { diff --git a/src/components/documents/document-month-grid.tsx b/src/components/documents/document-month-grid.tsx index fbad5dbdb..1fea76a4d 100644 --- a/src/components/documents/document-month-grid.tsx +++ b/src/components/documents/document-month-grid.tsx @@ -16,7 +16,7 @@ import { DocumentCard } from "./document-card"; /** Measured grid width → tiles per row. */ export function columnsForWidth(width: number): number { - if (width >= 1100) return 4; + if (width >= 1000) return 4; if (width >= 760) return 3; if (width >= 330) return 2; return 1; diff --git a/src/components/timeline/__tests__/lab-day-chip.test.tsx b/src/components/timeline/__tests__/lab-day-chip.test.tsx index 8f0852f83..e6d5b6c4f 100644 --- a/src/components/timeline/__tests__/lab-day-chip.test.tsx +++ b/src/components/timeline/__tests__/lab-day-chip.test.tsx @@ -68,8 +68,17 @@ function renderBar(): string { ); } -/** The text a reader sees, tags dropped. */ -const textOf = (html: string) => html.replace(/<[^>]*>/g, ""); +/** The text a reader sees, tags dropped (a character walk, not a regex). */ +function textOf(html: string): string { + let out = ""; + let inTag = false; + for (const ch of html) { + if (ch === "<") inTag = true; + else if (ch === ">") inTag = false; + else if (!inTag) out += ch; + } + return out; +} describe("lab day in the selection bar", () => { it("sets the count apart from the analyte names", () => {