diff --git a/frontend/src/lib/components/AnnotationLayer.svelte.test.ts b/frontend/src/lib/components/AnnotationLayer.svelte.test.ts index 81b87a84..1f549cd3 100644 --- a/frontend/src/lib/components/AnnotationLayer.svelte.test.ts +++ b/frontend/src/lib/components/AnnotationLayer.svelte.test.ts @@ -64,4 +64,32 @@ describe('AnnotationLayer', () => { expect(clickedId).toBe('ann-1'); }); }); + + describe('flashAnnotationId prop', () => { + it('should apply annotation-flash class when flashAnnotationId matches', async () => { + render(AnnotationLayer, { + annotations: [annotation], + canDraw: false, + color: '#00c7b1', + flashAnnotationId: 'ann-1', + onDraw: () => {} + }); + + const el = document.querySelector('[data-testid="annotation-ann-1"]')!; + expect(el.classList.contains('annotation-flash')).toBe(true); + }); + + it('should not apply annotation-flash class when flashAnnotationId does not match', async () => { + render(AnnotationLayer, { + annotations: [annotation], + canDraw: false, + color: '#00c7b1', + flashAnnotationId: 'other-id', + onDraw: () => {} + }); + + const el = document.querySelector('[data-testid="annotation-ann-1"]')!; + expect(el.classList.contains('annotation-flash')).toBe(false); + }); + }); });