From 22c58a22e7e524b1ad64b758db2d752f3eb6e851 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Wed, 8 Jan 2025 12:09:50 +0000 Subject: [PATCH] Update markdoc tests --- .../markdoc/test/propagated-assets.test.js | 12 ++++++------ packages/integrations/mdx/test/css-head-mdx.test.js | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/integrations/markdoc/test/propagated-assets.test.js b/packages/integrations/markdoc/test/propagated-assets.test.js index 5fe7369ceb52..a0768448f1d9 100644 --- a/packages/integrations/markdoc/test/propagated-assets.test.js +++ b/packages/integrations/markdoc/test/propagated-assets.test.js @@ -45,12 +45,12 @@ describe('Markdoc - propagated assets', () => { let styleContents; if (mode === 'dev') { const styles = stylesDocument.querySelectorAll('style'); - assert.equal(styles.length, 2); - styleContents = styles[1].textContent; + assert.equal(styles.length, 1); + styleContents = styles[0].textContent; } else { const links = stylesDocument.querySelectorAll('link[rel="stylesheet"]'); - assert.equal(links.length, 2); - styleContents = await fixture.readFile(links[1].href); + assert.equal(links.length, 1); + styleContents = await fixture.readFile(links[0].href); } assert.equal(styleContents.includes('--color-base-purple: 269, 79%;'), true); }); @@ -58,10 +58,10 @@ describe('Markdoc - propagated assets', () => { it('[fails] Does not bleed styles to other page', async () => { if (mode === 'dev') { const styles = scriptsDocument.querySelectorAll('style'); - assert.equal(styles.length, 1); + assert.equal(styles.length, 0); } else { const links = scriptsDocument.querySelectorAll('link[rel="stylesheet"]'); - assert.equal(links.length, 1); + assert.equal(links.length, 0); } }); }); diff --git a/packages/integrations/mdx/test/css-head-mdx.test.js b/packages/integrations/mdx/test/css-head-mdx.test.js index 3123b22cea71..96ee7c9001b3 100644 --- a/packages/integrations/mdx/test/css-head-mdx.test.js +++ b/packages/integrations/mdx/test/css-head-mdx.test.js @@ -39,7 +39,7 @@ describe('Head injection w/ MDX', () => { const { document } = parseHTML(html); const links = document.querySelectorAll('head link[rel=stylesheet]'); - assert.equal(links.length, 2); + assert.equal(links.length, 1); }); it('injects content from a component using Content#render()', async () => { @@ -47,7 +47,7 @@ describe('Head injection w/ MDX', () => { const { document } = parseHTML(html); const links = document.querySelectorAll('head link[rel=stylesheet]'); - assert.equal(links.length, 2); + assert.equal(links.length, 1); const scripts = document.querySelectorAll('script[type=module]'); assert.equal(scripts.length, 1); @@ -79,7 +79,7 @@ describe('Head injection w/ MDX', () => { const $ = cheerio.load(html); const headLinks = $('head link[rel=stylesheet]'); - assert.equal(headLinks.length, 2); + assert.equal(headLinks.length, 1); const bodyLinks = $('body link[rel=stylesheet]'); assert.equal(bodyLinks.length, 0);