summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/css-head-mdx.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-02-13 07:49:10 -0500
committerGravatar GitHub <noreply@github.com> 2023-02-13 07:49:10 -0500
commit79783fc0181153a8e379d3f023422510a7467ead (patch)
treea3114c6bf432a73782c7d9a1728abdeabc617ca8 /packages/integrations/mdx/test/css-head-mdx.test.js
parent79f49acbe13673bfc27e794bcfae518f38c4a4fe (diff)
downloadastro-79783fc0181153a8e379d3f023422510a7467ead.tar.gz
astro-79783fc0181153a8e379d3f023422510a7467ead.tar.zst
astro-79783fc0181153a8e379d3f023422510a7467ead.zip
Fix head injection in body with slots.render() and head buffering (#6216)
* Fix head injection in body with slots.render() and head buffering * Adding a changeset * An MDX test too
Diffstat (limited to 'packages/integrations/mdx/test/css-head-mdx.test.js')
-rw-r--r--packages/integrations/mdx/test/css-head-mdx.test.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/integrations/mdx/test/css-head-mdx.test.js b/packages/integrations/mdx/test/css-head-mdx.test.js
index bb2c7c0ef..781e4d62d 100644
--- a/packages/integrations/mdx/test/css-head-mdx.test.js
+++ b/packages/integrations/mdx/test/css-head-mdx.test.js
@@ -69,5 +69,17 @@ describe('Head injection w/ MDX', () => {
const bodyLinks = $('body link[rel=stylesheet]');
expect(bodyLinks).to.have.a.lengthOf(0);
});
+
+ it('JSX component rendering Astro children within head buffering phase', async () => {
+ const html = await fixture.readFile('/posts/using-component/index.html');
+ // Using cheerio here because linkedom doesn't support head tag injection
+ const $ = cheerio.load(html);
+
+ const headLinks = $('head link[rel=stylesheet]');
+ expect(headLinks).to.have.a.lengthOf(1);
+
+ const bodyLinks = $('body link[rel=stylesheet]');
+ expect(bodyLinks).to.have.a.lengthOf(0);
+ });
});
});