diff options
author | 2025-01-10 22:55:57 +0800 | |
---|---|---|
committer | 2025-01-10 22:55:57 +0800 | |
commit | bee7df740951664e9d4f19e2ed77afda23dbaafc (patch) | |
tree | 87736e7eb7a4c1dc790eeeb03638ee7a81f5b49d | |
parent | 4b7a2ce9e743a5624617563022635678a5ba6051 (diff) | |
download | astro-bee7df740951664e9d4f19e2ed77afda23dbaafc.tar.gz astro-bee7df740951664e9d4f19e2ed77afda23dbaafc.tar.zst astro-bee7df740951664e9d4f19e2ed77afda23dbaafc.zip |
Add inline mdx component test (#12965)
-rw-r--r-- | packages/integrations/mdx/test/fixtures/mdx-plus-react/src/pages/inline-component.mdx | 5 | ||||
-rw-r--r-- | packages/integrations/mdx/test/mdx-plus-react.test.js | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/packages/integrations/mdx/test/fixtures/mdx-plus-react/src/pages/inline-component.mdx b/packages/integrations/mdx/test/fixtures/mdx-plus-react/src/pages/inline-component.mdx new file mode 100644 index 000000000..4071a2c70 --- /dev/null +++ b/packages/integrations/mdx/test/fixtures/mdx-plus-react/src/pages/inline-component.mdx @@ -0,0 +1,5 @@ +export const Comp = () => <span>Comp</span> + +# Inline component + +This is an inline component: <Comp /> diff --git a/packages/integrations/mdx/test/mdx-plus-react.test.js b/packages/integrations/mdx/test/mdx-plus-react.test.js index 08c0f118c..0aa3ed459 100644 --- a/packages/integrations/mdx/test/mdx-plus-react.test.js +++ b/packages/integrations/mdx/test/mdx-plus-react.test.js @@ -47,4 +47,9 @@ describe('MDX and React', () => { const errors = unhook(); assert.equal(errors.length === 0, true); }); + + it('renders inline mdx component', async () => { + const html = await fixture.readFile('/inline-component/index.html'); + assert.match(html, /This is an inline component: <span>Comp<\/span>/); + }); }); |