diff --git a/src/components/labs/__tests__/ocr-row-editor.test.tsx b/src/components/labs/__tests__/ocr-row-editor.test.tsx index aef017711..e28f27093 100644 --- a/src/components/labs/__tests__/ocr-row-editor.test.tsx +++ b/src/components/labs/__tests__/ocr-row-editor.test.tsx @@ -176,6 +176,18 @@ describe(" unit differs but converts", () => { expect(html).not.toContain('aria-invalid="true"'); }); + it("wraps the sentence instead of cutting off the printed value", () => { + const html = render(undefined, "en", converts); + const badge = + /]*data-slot="ocr-row-converted-badge"[^>]*>([\s\S]*?)<\/span><\/span>/.exec( + html, + ); + expect(badge).not.toBeNull(); + const tag = badge![0].slice(0, badge![0].indexOf(">")); + expect(tag).toContain("whitespace-normal"); + expect(badge![0]).not.toContain("truncate"); + }); + it("speaks German too", () => { const html = render(undefined, "de", converts); expect(html).toContain("umgerechnet aus 5,6 mmol/L"); diff --git a/src/components/labs/ocr-row-editor.tsx b/src/components/labs/ocr-row-editor.tsx index 338c90a85..221906e5f 100644 --- a/src/components/labs/ocr-row-editor.tsx +++ b/src/components/labs/ocr-row-editor.tsx @@ -191,11 +191,13 @@ export function OcrRowEditor({ {conversion ? ( - + {t("labs.ocr.unitConvertedBadge", { value: labNumber(conversion.value), markerUnit: conversion.unit,