mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
fix(medications): separate the two container dates and name the ampoule caveat
The row printed the opening date and the printed expiry with nothing between them. It carries the same middle dot the unit figures use. The docblock now says out loud what the enum cannot distinguish: AMPOULE covers both a punctured multi-dose vial, where the post-opening window is real, and a carton of single-use glass ampoules, where it is not. The kind is never auto-selected, so picking it is a statement about an opened container, and the opening date is editable when it turns out not to be.
This commit is contained in:
1 parent
a4ff11f10d
commit
fd1464867d
3 files changed
+23
-1
No files matched your search
@@ -124,6 +124,22 @@ describe("<InventorySection> — item-row dates", () => {
|
||||
expect(html).toContain("Haltbar bis 01.06.2027");
|
||||
});
|
||||
|
||||
it("separates the two dates when the row carries both", () => {
|
||||
seedItems([
|
||||
{
|
||||
...BASE,
|
||||
firstUseAt: "2026-06-12T00:00:00.000Z",
|
||||
printedExpiry: "2027-06-01T00:00:00.000Z",
|
||||
},
|
||||
]);
|
||||
const html = render(
|
||||
<InventorySection medicationId="med-1" unitsPerDose={1} />,
|
||||
);
|
||||
expect(html).toContain("Geöffnet 12.06.2026");
|
||||
expect(html).toContain("Haltbar bis 01.06.2027");
|
||||
expect(html).toContain("<span>·</span>");
|
||||
});
|
||||
|
||||
it("shows no date line when neither date is recorded", () => {
|
||||
// Absence reads as absence — no placeholder, no invented date.
|
||||
seedItems([{ ...BASE, firstUseAt: null, printedExpiry: null }]);
|
||||
|
||||
@@ -505,6 +505,7 @@ export function InventorySection({
|
||||
})}
|
||||
</span>
|
||||
)}
|
||||
{item.firstUseAt && item.printedExpiry && <span>·</span>}
|
||||
{item.printedExpiry && (
|
||||
<span>
|
||||
{t("medications.detail.bestand.expiresOn", {
|
||||
|
||||
Reference in new issue
Block a user