From aade85a0fffc8eb2ffd3931c110ed96e46afbf42 Mon Sep 17 00:00:00 2001 From: SeinopSys Date: Sun, 3 Apr 2022 03:03:32 +0200 Subject: [PATCH] fix coverage for tag utils --- assets/js/utils/__tests__/tag.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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', () => {