diff --git a/test/utils/mocks/body-gnav.html b/test/utils/mocks/body-gnav.html new file mode 100644 index 0000000000..77a1ee40c3 --- /dev/null +++ b/test/utils/mocks/body-gnav.html @@ -0,0 +1,36 @@ +
+
+
+ +
+
+
+
+
+

Creativity + & Design

+
+
+
+
+
+
+
+
+

Help & + Support

+
+
+
+
+
+

Just link

+
+
+
diff --git a/test/utils/utils.test.js b/test/utils/utils.test.js index d82a7123f0..619c418382 100644 --- a/test/utils/utils.test.js +++ b/test/utils/utils.test.js @@ -74,6 +74,14 @@ describe('Utils', () => { }); }); + it('renders global navigation when header tag is present', async ()=> { + const bodyWithheader = await readFile({ path: './mocks/body-gnav.html' }); + document.head.innerHTML = head; + document.body.innerHTML = bodyWithheader; + await utils.loadArea(); + expect(document.querySelector('.global-navigation')).to.exist; + }); + describe('with body', () => { beforeEach(async () => { window.fetch = mockFetch({ payload: { data: '' } });