diff --git a/frontend/src/lib/components/ThumbnailRow.svelte.spec.ts b/frontend/src/lib/components/ThumbnailRow.svelte.spec.ts index ae0542e1..9c41fc65 100644 --- a/frontend/src/lib/components/ThumbnailRow.svelte.spec.ts +++ b/frontend/src/lib/components/ThumbnailRow.svelte.spec.ts @@ -104,6 +104,20 @@ describe('ThumbnailRow', () => { expect(document.body.textContent).toContain('vor 76 Jahren'); }); + it('hides the relative-year label when documentDate is in the future', () => { + // relativeYearsDe returns "" for future/invalid dates; the row must not + // then render an empty chip or print "vor 0 Jahren". + render(ThumbnailRow, { + doc: { ...baseDoc, documentDate: '2030-01-01' }, + isOut: true, + showOtherParty: false, + now: new Date('2026-06-01T00:00:00Z') + }); + + expect(document.body.textContent).not.toMatch(/vor \d+ Jahr/); + expect(document.body.textContent).not.toMatch(/vor weniger/); + }); + it('sets border-l class based on isOut', () => { const { unmount } = render(ThumbnailRow, { doc: baseDoc,