diff options
Diffstat (limited to 'packages/integrations/markdoc/test/image-assets.test.js')
| -rw-r--r-- | packages/integrations/markdoc/test/image-assets.test.js | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/packages/integrations/markdoc/test/image-assets.test.js b/packages/integrations/markdoc/test/image-assets.test.js index ae576b5cf..880ee9b26 100644 --- a/packages/integrations/markdoc/test/image-assets.test.js +++ b/packages/integrations/markdoc/test/image-assets.test.js @@ -51,6 +51,13 @@ describe('Markdoc - Image assets', () => {  				/\/_image\?href=.*%2Fsrc%2Fassets%2Falias%2Fcityscape.jpg%3ForigWidth%3D420%26origHeight%3D280%26origFormat%3Djpg&f=webp/  			);  		}); + +		it('passes images inside image tags to configured image component', async () => { +			const res = await baseFixture.fetch('/'); +			const html = await res.text(); +			const { document } = parseHTML(html); +			assert.equal(document.querySelector('#component > img')?.className, 'custom-styles'); +		});  	});  	describe('build', () => { @@ -75,5 +82,12 @@ describe('Markdoc - Image assets', () => {  			const { document } = parseHTML(html);  			assert.match(document.querySelector('#alias > img')?.src, /^\/_astro\/cityscape.*\.webp$/);  		}); + +		it('passes images inside image tags to configured image component', async () => { +			const html = await baseFixture.readFile('/index.html'); +			const { document } = parseHTML(html); +			assert.equal(document.querySelector('#component > img')?.className, 'custom-styles'); +			assert.match(document.querySelector('#component > img')?.src, /^\/_astro\/oar.*\.webp$/); +		});  	});  }); | 
