diff --git a/frontend/src/lib/components/TranscriptionReadView.svelte.test.ts b/frontend/src/lib/components/TranscriptionReadView.svelte.test.ts index 7c9b3d76..70823be2 100644 --- a/frontend/src/lib/components/TranscriptionReadView.svelte.test.ts +++ b/frontend/src/lib/components/TranscriptionReadView.svelte.test.ts @@ -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: [],