feat(timeline): give LetterCard an event variant and chip suppression
Add a `variant="event"` that marks the card `.lcard.ev` for Ereignis-mode event clusters (#827, REQ-014) and a `suppressTagChip` that hides the per-letter TagChip inside its own Thema bucket where the header already conveys the topic (REQ-017). Datum/Ereignis keep the #838 per-letter chip behaviour. Refs #827 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -127,3 +127,28 @@ describe('LetterCard', () => {
|
||||
expect(chip?.textContent).toContain('Familie');
|
||||
});
|
||||
});
|
||||
|
||||
describe('LetterCard — grouping variants (#827, REQ-014/017)', () => {
|
||||
it('carries the .lcard.ev class in the event variant (REQ-014)', () => {
|
||||
render(LetterCard, { entry: makeEntry(), variant: 'event' });
|
||||
expect(document.querySelector('a.lcard.ev')).not.toBeNull();
|
||||
});
|
||||
|
||||
it('is a plain card with no .ev marker by default (REQ-014)', () => {
|
||||
render(LetterCard, { entry: makeEntry() });
|
||||
expect(document.querySelector('a.ev')).toBeNull();
|
||||
});
|
||||
|
||||
it('suppresses the per-letter tag chip when asked, even with a root tag (REQ-017)', () => {
|
||||
render(LetterCard, {
|
||||
entry: makeEntry({ rootTagName: 'Krieg', rootTagColor: 'sienna' }),
|
||||
suppressTagChip: true
|
||||
});
|
||||
expect(document.querySelector('[data-testid="tag-chip"]')).toBeNull();
|
||||
});
|
||||
|
||||
it('still shows the per-letter tag chip when not suppressed — Datum/Ereignis (REQ-017)', () => {
|
||||
render(LetterCard, { entry: makeEntry({ rootTagName: 'Krieg', rootTagColor: 'sienna' }) });
|
||||
expect(document.querySelector('[data-testid="tag-chip"]')).not.toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user