test(ui): add flash-highlight class tests for TranscriptionReadView

Verifies highlightBlockId applies and removes the flash-highlight
CSS class correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-07 11:44:01 +02:00
parent 4d5b8b4ead
commit 90120ca8e8

View File

@@ -108,6 +108,28 @@ describe('TranscriptionReadView', () => {
expect(paragraphs[1].getAttribute('data-block-id')).toBe('b1');
});
it('should apply flash-highlight class when highlightBlockId matches', async () => {
render(TranscriptionReadView, {
blocks: [blocks[0]],
onParagraphClick: () => {},
highlightBlockId: 'b1'
});
const el = document.querySelector('[data-block-id="b1"]')!;
expect(el.classList.contains('flash-highlight')).toBe(true);
});
it('should not apply flash-highlight class when highlightBlockId does not match', async () => {
render(TranscriptionReadView, {
blocks: [blocks[0]],
onParagraphClick: () => {},
highlightBlockId: 'other-id'
});
const el = document.querySelector('[data-block-id="b1"]')!;
expect(el.classList.contains('flash-highlight')).toBe(false);
});
it('should render empty state when no blocks', async () => {
render(TranscriptionReadView, {
blocks: [],