diff options
author | 2023-10-27 11:45:02 +0200 | |
---|---|---|
committer | 2023-10-27 17:45:02 +0800 | |
commit | 01c801108f1f5429436e4fc930018bf96ed31f79 (patch) | |
tree | 8fd6273aebe6a19336cdce4c21f0411ffa7b3848 /packages/integrations/markdoc/test/render.test.js | |
parent | 35c5265dc2b1e5940e14eebc50c7ccff98fe5f3b (diff) | |
download | astro-01c801108f1f5429436e4fc930018bf96ed31f79.tar.gz astro-01c801108f1f5429436e4fc930018bf96ed31f79.tar.zst astro-01c801108f1f5429436e4fc930018bf96ed31f79.zip |
Fix: Markdoc Integration build when root folder contains spaces (#8759)
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/markdoc/test/render.test.js')
-rw-r--r-- | packages/integrations/markdoc/test/render.test.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/integrations/markdoc/test/render.test.js b/packages/integrations/markdoc/test/render.test.js index 3ac9c3ac4..f1760a8e6 100644 --- a/packages/integrations/markdoc/test/render.test.js +++ b/packages/integrations/markdoc/test/render.test.js @@ -69,6 +69,18 @@ describe('Markdoc - render', () => { await server.stop(); }); + + it('renders content - with root folder containing space', async () => { + const fixture = await getFixture('render with-space'); + const server = await fixture.startDevServer(); + + const res = await fixture.fetch('/'); + const html = await res.text(); + + renderWithRootFolderContainingSpace(html); + + await server.stop(); + }); }); describe('build', () => { @@ -116,6 +128,15 @@ describe('Markdoc - render', () => { renderNullChecks(html); }); + + it('renders content - with root folder containing space', async () => { + const fixture = await getFixture('render with-space'); + await fixture.build(); + + const html = await fixture.readFile('/index.html'); + + renderWithRootFolderContainingSpace(html); + }); }); }); @@ -189,3 +210,14 @@ function renderSimpleChecks(html) { const p = document.querySelector('p'); expect(p.textContent).to.equal('This is a simple Markdoc post.'); } + +/** @param {string} html */ +function renderWithRootFolderContainingSpace(html) { + const { document } = parseHTML(html); + const h2 = document.querySelector('h2'); + expect(h2.textContent).to.equal('Simple post with root folder containing a space'); + const p = document.querySelector('p'); + expect(p.textContent).to.equal( + 'This is a simple Markdoc post with root folder containing a space.' + ); +} |