test(activity): assert Chronik rows never fabricate a letter date
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 2m54s
CI / OCR Service Tests (pull_request) Successful in 22s
CI / Backend Unit Tests (pull_request) Successful in 3m30s
CI / fail2ban Regex (pull_request) Successful in 45s
CI / Semgrep Security Scan (pull_request) Successful in 20s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m3s

Negative guarantee for #668: ChronikRow renders the activity timestamp
(happenedAt), and ActivityFeedItemDTO carries no document-date surface, so
no undated badge or "Datum unbekannt" letter-date label may appear. Pins
this as a regression fixture so a future change can't quietly add a date
chip to the activity feed.

Refs #668
This commit is contained in:
Marcel
2026-05-27 18:54:35 +02:00
parent 098c2c9def
commit a345bba74b

View File

@@ -44,6 +44,17 @@ describe('ChronikRow', () => {
expect(link).not.toBeNull(); expect(link).not.toBeNull();
}); });
// --- #668 negative guarantee: Chronik never fabricates a letter date ---
it('renders the activity timestamp, not a letter date, and no undated badge', async () => {
// The row shows the relative activity time (happenedAt), never the letter's
// documentDate — ActivityFeedItemDTO carries no date surface to badge.
render(ChronikRow, { item: baseItem });
// No undated badge is introduced into a Chronik row.
expect(document.querySelector('[data-testid="undated-badge"]')).toBeNull();
// No fabricated "Datum unbekannt" letter-date label appears.
await expect.element(page.getByText('Datum unbekannt')).not.toBeInTheDocument();
});
// --- simple variant --- // --- simple variant ---
it('renders simple variant when count === 1 and not a mention', async () => { it('renders simple variant when count === 1 and not a mention', async () => {
render(ChronikRow, { item: baseItem }); render(ChronikRow, { item: baseItem });