From 222712f7a16ac9a1ae97f5c2f45aa3ee850ec01c Mon Sep 17 00:00:00 2001 From: Vito Galatro Date: Wed, 18 Oct 2023 16:53:22 -0400 Subject: [PATCH] THEMES-967: improved coverage for ad block tests. --- blocks/ads-block/features/ads/ad-helper.test.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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()", () => {