summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/test/css-head-mdx.test.js
diff options
context:
space:
mode:
authorGravatar Matt Kane <m@mk.gg> 2024-11-15 13:29:52 +0000
committerGravatar GitHub <noreply@github.com> 2024-11-15 13:29:52 +0000
commitaf867f3910ecd8fc04a5337f591d84f03192e3fa (patch)
treea5e5b267915c01010a1f608629c412c255d13470 /packages/integrations/mdx/test/css-head-mdx.test.js
parentc8f877cad2d8f1780f70045413872d5b9d32ebed (diff)
downloadastro-af867f3910ecd8fc04a5337f591d84f03192e3fa.tar.gz
astro-af867f3910ecd8fc04a5337f591d84f03192e3fa.tar.zst
astro-af867f3910ecd8fc04a5337f591d84f03192e3fa.zip
feat: experimental responsive images (#12377)
* chore: changeset * feat: add experimental responsive images config option (#12378) * feat: add experimental responsive images config option * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update config types * Move config into `images` * Move jsdocs --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * feat: add responsive image component (#12381) * feat: add experimental responsive images config option * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * Update config types * Move config into `images` * Move jsdocs * wip: responsive image component * Improve srcset logic * Improve fixture * Lock * Update styling * Fix style prop handling * Update test (there's an extra style for images now) * Safely access the src props * Remove unused export * Handle priority images * Consolidate styles * Update tests * Comment * Refactor srcset * Avoid dupes of original image * Calculate missing dimensions * Bugfixes * Add tests * Fix test * Correct order * Lint * Fix fspath * Update test * Fix test * Conditional component per flag * Fix class concatenation * Remove logger * Rename helper * Add comments * Format * Fix markdoc tests * Add test for style tag --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * feat: add crop support to image services (#12414) * wip: add crop support to image services * Add tests * Strip crop attributes * Don't upscale * Format * Get build working properly * Changes from review * Fix jsdoc * feat: add responsive support to picture component (#12423) * feat: add responsive support to picture component * Add picture tests * Fix test * Implement own define vars * Share logic * Prevent extra astro-* class * Use dataset scoping * Revert unit test * Revert "Fix test" This reverts commit f9ec6e2938ff291037234d56f8eec76a93be0c0d. * Changes from review * docs: add docs for responsive images (#12429) * docs: add responsive images flag docs * docs: adds jsdoc for image components * chore: updates from review * Fix jsdoc * Changes from review * Add breakpoints option * typo --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'packages/integrations/mdx/test/css-head-mdx.test.js')
-rw-r--r--packages/integrations/mdx/test/css-head-mdx.test.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/integrations/mdx/test/css-head-mdx.test.js b/packages/integrations/mdx/test/css-head-mdx.test.js
index 96ee7c900..d55e2f52a 100644
--- a/packages/integrations/mdx/test/css-head-mdx.test.js
+++ b/packages/integrations/mdx/test/css-head-mdx.test.js
@@ -28,7 +28,7 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- assert.equal(links.length, 1);
+ assert.equal(links.length, 2);
const scripts = document.querySelectorAll('script[type=module]');
assert.equal(scripts.length, 1);
@@ -39,7 +39,7 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- assert.equal(links.length, 1);
+ assert.equal(links.length, 2);
});
it('injects content from a component using Content#render()', async () => {
@@ -47,7 +47,7 @@ describe('Head injection w/ MDX', () => {
const { document } = parseHTML(html);
const links = document.querySelectorAll('head link[rel=stylesheet]');
- assert.equal(links.length, 1);
+ assert.equal(links.length, 2);
const scripts = document.querySelectorAll('script[type=module]');
assert.equal(scripts.length, 1);
@@ -67,7 +67,7 @@ describe('Head injection w/ MDX', () => {
const $ = cheerio.load(html);
const headLinks = $('head link[rel=stylesheet]');
- assert.equal(headLinks.length, 1);
+ assert.equal(headLinks.length, 2);
const bodyLinks = $('body link[rel=stylesheet]');
assert.equal(bodyLinks.length, 0);
@@ -79,7 +79,7 @@ describe('Head injection w/ MDX', () => {
const $ = cheerio.load(html);
const headLinks = $('head link[rel=stylesheet]');
- assert.equal(headLinks.length, 1);
+ assert.equal(headLinks.length, 2);
const bodyLinks = $('body link[rel=stylesheet]');
assert.equal(bodyLinks.length, 0);
@@ -92,7 +92,7 @@ describe('Head injection w/ MDX', () => {
const $ = cheerio.load(html);
const headLinks = $('head link[rel=stylesheet]');
- assert.equal(headLinks.length, 1);
+ assert.equal(headLinks.length, 2);
const bodyLinks = $('body link[rel=stylesheet]');
assert.equal(bodyLinks.length, 0);