fix(timeline): show EventPill provenance even when the event has no date
The provenance token (abgeleitet/kuratiert) was nested inside the
{#if dateLabel} block, so an undated or UNKNOWN-precision event — e.g.
one in the undated bucket — rendered no provenance at all. Compose the
subtitle as an optional "{date} · " prefix in front of the always-present
provenance instead.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -120,4 +120,23 @@ describe('EventPill', () => {
|
||||
expect(document.body.textContent).not.toContain('persönlich');
|
||||
expect(document.body.textContent).not.toContain('SEASON');
|
||||
});
|
||||
|
||||
it('still shows the provenance token when the event has no date label (REQ-007)', () => {
|
||||
// An undated / UNKNOWN-precision event (e.g. in the undated bucket) yields a
|
||||
// null dateLabel; provenance must not be gated behind the date.
|
||||
const entry = makeEntry({
|
||||
kind: 'EVENT',
|
||||
derived: true,
|
||||
derivedType: 'BIRTH',
|
||||
title: 'Geburt: Hans',
|
||||
senderName: '',
|
||||
receiverName: '',
|
||||
precision: 'UNKNOWN',
|
||||
eventDate: undefined,
|
||||
documentId: undefined
|
||||
});
|
||||
expect(timelineDateLabel(entry.eventDate, entry.precision, entry.eventDateEnd)).toBeNull();
|
||||
render(EventPill, { entry });
|
||||
expect(document.body.textContent).toContain(m.timeline_provenance_derived());
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user