diff --git a/blocks/ads-block/features/ads/ad-helper.test.js b/blocks/ads-block/features/ads/ad-helper.test.js index 532c8807f1..ce7ce5c647 100644 --- a/blocks/ads-block/features/ads/ad-helper.test.js +++ b/blocks/ads-block/features/ads/ad-helper.test.js @@ -212,7 +212,7 @@ describe("ad-helper", () => { }); describe("getTags()", () => { - it('returns empty string with invalid "globalContent"', () => { + it("returns empty string with invalid 'globalContent'", () => { const tags = getTags(); expect(tags).toBeDefined(); expect(tags).toBe(""); @@ -224,6 +224,17 @@ describe("ad-helper", () => { expect(tags).toContain(tag.slug); }); }); + it("returns empty sting when tags are empty", () => { + const tags = getTags({ + globalContent: { + taxonomy: { + tags: [{}, {}], + }, + }, + }); + expect(tags).toBeDefined(); + expect(tags).toBe(""); + }); }); describe("getPageType()", () => {