diff --git a/assets/js/utils/__tests__/tag.spec.ts b/assets/js/utils/__tests__/tag.spec.ts index 65cbc21a..9f2158c1 100644 --- a/assets/js/utils/__tests__/tag.spec.ts +++ b/assets/js/utils/__tests__/tag.spec.ts @@ -144,6 +144,12 @@ describe('Tag utilities', () => { mockTagInfo[4], ]); }); + + it('should return empty array if data attribute is missing', () => { + const mockImage = new Image(); + const result = imageHitsTags(mockImage, []); + expect(result).toEqual([]); + }); }); describe('imageHitsComplex', () => {