summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/css-head-mdx.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/mdx/test/css-head-mdx.test.js')
-rw-r--r--packages/integrations/mdx/test/css-head-mdx.test.js27
1 files changed, 27 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 2b1dcdfe7..c38f23701 100644
--- a/packages/integrations/mdx/test/css-head-mdx.test.js
+++ b/packages/integrations/mdx/test/css-head-mdx.test.js
@@ -29,5 +29,32 @@ describe('Head injection w/ MDX', () => {
const scripts = document.querySelectorAll('head script[type=module]');
expect(scripts).to.have.a.lengthOf(1);
});
+
+ it('injects into the head for content collections', async () => {
+ const html = await fixture.readFile('/posts/test/index.html');
+ const { document } = parseHTML(html);
+
+ const links = document.querySelectorAll('head link[rel=stylesheet]');
+ expect(links).to.have.a.lengthOf(1);
+ });
+
+ it('injects content from a component using Content#render()', async () => {
+ const html = await fixture.readFile('/DirectContentUsage/index.html');
+ const { document } = parseHTML(html);
+
+ const links = document.querySelectorAll('head link[rel=stylesheet]');
+ expect(links).to.have.a.lengthOf(1);
+
+ const scripts = document.querySelectorAll('head script[type=module]');
+ expect(scripts).to.have.a.lengthOf(2);
+ });
+
+ it('Using component using slots.render() API', async () => {
+ const html = await fixture.readFile('/remote/index.html');
+ const { document } = parseHTML(html);
+
+ const links = document.querySelectorAll('head link[rel=stylesheet]');
+ expect(links).to.have.a.lengthOf(1);
+ });
});
});