Skip to content

Commit

Permalink
THEMES-967: improved coverage for ad block tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vgalatro committed Oct 18, 2023
1 parent 8bdf9d4 commit 222712f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion blocks/ads-block/features/ads/ad-helper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
Expand All @@ -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()", () => {
Expand Down

0 comments on commit 222712f

Please sign in to comment.