From 90120ca8e8ac1e0dc018cde3e39e4ff0d9eef9d2 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 7 Apr 2026 11:44:01 +0200 Subject: [PATCH] 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 --- .../TranscriptionReadView.svelte.test.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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: [],