summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/mdx-optimize.test.js
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2024-09-13 16:08:58 -0400
committerGravatar Matthew Phillips <matthew@skypack.dev> 2024-09-13 16:08:58 -0400
commit4724b144310a88defd839f183bec927e5e3cdec0 (patch)
treeb17f6d84a7013f22a04ac578f9e115a8afe4cc3e /packages/integrations/mdx/test/mdx-optimize.test.js
parentbf90a5343f9cd1bb46f30e4b331e7ae675f5e720 (diff)
parent27d19f612f5627b86ca3a9de26239fd2dce32092 (diff)
downloadastro-4724b144310a88defd839f183bec927e5e3cdec0.tar.gz
astro-4724b144310a88defd839f183bec927e5e3cdec0.tar.zst
astro-4724b144310a88defd839f183bec927e5e3cdec0.zip
Merge branch 'main' into next
Diffstat (limited to 'packages/integrations/mdx/test/mdx-optimize.test.js')
-rw-r--r--packages/integrations/mdx/test/mdx-optimize.test.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/integrations/mdx/test/mdx-optimize.test.js b/packages/integrations/mdx/test/mdx-optimize.test.js
index 47acfdff8..c45ecda15 100644
--- a/packages/integrations/mdx/test/mdx-optimize.test.js
+++ b/packages/integrations/mdx/test/mdx-optimize.test.js
@@ -47,4 +47,15 @@ describe('MDX optimize', () => {
assert.notEqual(blockquote, null);
assert.equal(blockquote.textContent.includes('I like pancakes'), true);
});
+
+ it('renders MDX with rehype plugin that incorrectly injects root hast node', async () => {
+ const html = await fixture.readFile('/import/index.html');
+ const { document } = parseHTML(html);
+
+ assert.doesNotMatch(html, /set:html=/);
+ assert.equal(
+ document.getElementById('injected-root-hast').textContent,
+ 'Injected root hast from rehype plugin',
+ );
+ });
});