From 4186664db0bc33617b725de5826942dd130a1581 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Wed, 1 Mar 2023 14:21:08 -0500 Subject: [PATCH] test: update fixture to match new config --- .../content-collections/astro.config.mjs | 19 ++++++++++++- .../src/components/Code.astro | 12 ++++++++ .../src/pages/content-with-components.astro | 28 ++----------------- .../src/pages/content-with-config.astro | 21 +------------- 4 files changed, 33 insertions(+), 47 deletions(-) create mode 100644 packages/integrations/markdoc/test/fixtures/content-collections/src/components/Code.astro diff --git a/packages/integrations/markdoc/test/fixtures/content-collections/astro.config.mjs b/packages/integrations/markdoc/test/fixtures/content-collections/astro.config.mjs index 29d846359..5e75827e9 100644 --- a/packages/integrations/markdoc/test/fixtures/content-collections/astro.config.mjs +++ b/packages/integrations/markdoc/test/fixtures/content-collections/astro.config.mjs @@ -3,5 +3,22 @@ import markdoc from '@astrojs/markdoc'; // https://astro.build/config export default defineConfig({ - integrations: [markdoc()], + integrations: [markdoc({ + variables: { + showMarquee: true, + }, + tags: { + mq: { + render: 'marquee', + attributes: { + direction: { + type: String, + default: 'left', + matches: ['left', 'right', 'up', 'down'], + errorLevel: 'critical', + }, + }, + }, + } + })], }); diff --git a/packages/integrations/markdoc/test/fixtures/content-collections/src/components/Code.astro b/packages/integrations/markdoc/test/fixtures/content-collections/src/components/Code.astro new file mode 100644 index 000000000..6cd2f0222 --- /dev/null +++ b/packages/integrations/markdoc/test/fixtures/content-collections/src/components/Code.astro @@ -0,0 +1,12 @@ +--- +import { Code } from 'astro/components'; + +type Props = { + 'data-language'?: string; +} + +const { 'data-language': lang } = Astro.props as Props; +const code = await Astro.slots.render('default'); +--- + + diff --git a/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-components.astro b/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-components.astro index ad65bec64..2b4cb36d5 100644 --- a/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-components.astro +++ b/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-components.astro @@ -1,8 +1,7 @@ --- import { getEntryBySlug } from "astro:content"; -import { Code } from 'astro/components'; +import Code from '../components/Code.astro'; import CustomMarquee from '../components/CustomMarquee.astro'; -import Markdoc from '@markdoc/markdoc'; const post = await getEntryBySlug('blog', 'with-components'); const { Content } = await post.render(); @@ -18,32 +17,9 @@ const { Content } = await post.render(); diff --git a/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-config.astro b/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-config.astro index d63e2b422..f37217a62 100644 --- a/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-config.astro +++ b/packages/integrations/markdoc/test/fixtures/content-collections/src/pages/content-with-config.astro @@ -14,25 +14,6 @@ const { Content } = await post.render(); Content - with config - +