summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/test/content-collections.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/markdoc/test/content-collections.test.js')
-rw-r--r--packages/integrations/markdoc/test/content-collections.test.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/packages/integrations/markdoc/test/content-collections.test.js b/packages/integrations/markdoc/test/content-collections.test.js
index 5417f297d..48e97d45d 100644
--- a/packages/integrations/markdoc/test/content-collections.test.js
+++ b/packages/integrations/markdoc/test/content-collections.test.js
@@ -13,6 +13,8 @@ function formatPost(post) {
const root = new URL('./fixtures/content-collections/', import.meta.url);
+const sortById = (a, b) => a.id.localeCompare(b.id);
+
describe('Markdoc - Content Collections', () => {
let baseFixture;
@@ -46,7 +48,7 @@ describe('Markdoc - Content Collections', () => {
assert.notEqual(posts, null);
assert.deepEqual(
- posts.sort().map((post) => formatPost(post)),
+ posts.sort(sortById).map((post) => formatPost(post)),
[post1Entry, post2Entry, post3Entry],
);
});
@@ -68,7 +70,7 @@ describe('Markdoc - Content Collections', () => {
const posts = parseDevalue(res);
assert.notEqual(posts, null);
assert.deepEqual(
- posts.sort().map((post) => formatPost(post)),
+ posts.sort(sortById).map((post) => formatPost(post)),
[post1Entry, post2Entry, post3Entry],
);
});
@@ -83,7 +85,10 @@ const post1Entry = {
schemaWorks: true,
title: 'Post 1',
},
- body: '\n## Post 1\n\nThis is the contents of post 1.\n',
+ body: '## Post 1\n\nThis is the contents of post 1.',
+ deferredRender: true,
+ filePath: 'src/content/blog/post-1.mdoc',
+ digest: '5d5bd98d949e2b9a',
};
const post2Entry = {
@@ -94,7 +99,10 @@ const post2Entry = {
schemaWorks: true,
title: 'Post 2',
},
- body: '\n## Post 2\n\nThis is the contents of post 2.\n',
+ body: '## Post 2\n\nThis is the contents of post 2.',
+ deferredRender: true,
+ filePath: 'src/content/blog/post-2.mdoc',
+ digest: '595af4b93a4af072',
};
const post3Entry = {
@@ -105,5 +113,8 @@ const post3Entry = {
schemaWorks: true,
title: 'Post 3',
},
- body: '\n## Post 3\n\nThis is the contents of post 3.\n',
+ body: '## Post 3\n\nThis is the contents of post 3.',
+ deferredRender: true,
+ filePath: 'src/content/blog/post-3.mdoc',
+ digest: 'ef589606e542247e',
};