mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 17:07:08 +02:00
fix(content-blog): temporarily swallow feed mdxToHtml errors + feed refactor (#5753)
This commit is contained in:
parent
fd41239f4f
commit
29d13351a4
9 changed files with 234 additions and 109 deletions
|
@ -246,26 +246,29 @@ describe('loadBlog', () => {
|
|||
test('simple website blog dates localized', async () => {
|
||||
const siteDir = path.join(__dirname, '__fixtures__', 'website');
|
||||
const blogPostsFrench = await getBlogPosts(siteDir, {}, getI18n('fr'));
|
||||
expect(blogPostsFrench).toHaveLength(7);
|
||||
expect(blogPostsFrench).toHaveLength(8);
|
||||
expect(blogPostsFrench[0].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"5 mars 2021"`,
|
||||
`"6 mars 2021"`,
|
||||
);
|
||||
expect(blogPostsFrench[1].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"16 août 2020"`,
|
||||
`"5 mars 2021"`,
|
||||
);
|
||||
expect(blogPostsFrench[2].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"15 août 2020"`,
|
||||
`"16 août 2020"`,
|
||||
);
|
||||
expect(blogPostsFrench[3].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"27 février 2020"`,
|
||||
`"15 août 2020"`,
|
||||
);
|
||||
expect(blogPostsFrench[4].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"2 janvier 2019"`,
|
||||
`"27 février 2020"`,
|
||||
);
|
||||
expect(blogPostsFrench[5].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"1 janvier 2019"`,
|
||||
`"2 janvier 2019"`,
|
||||
);
|
||||
expect(blogPostsFrench[6].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"1 janvier 2019"`,
|
||||
);
|
||||
expect(blogPostsFrench[7].metadata.formattedDate).toMatchInlineSnapshot(
|
||||
`"14 décembre 2018"`,
|
||||
);
|
||||
});
|
||||
|
@ -295,7 +298,8 @@ describe('loadBlog', () => {
|
|||
expect(blogPost.metadata.editUrl).toEqual(hardcodedEditUrl);
|
||||
});
|
||||
|
||||
expect(editUrlFunction).toHaveBeenCalledTimes(7);
|
||||
expect(editUrlFunction).toHaveBeenCalledTimes(8);
|
||||
|
||||
expect(editUrlFunction).toHaveBeenCalledWith({
|
||||
blogDirPath: 'blog',
|
||||
blogPath: 'date-matter.md',
|
||||
|
@ -314,6 +318,12 @@ describe('loadBlog', () => {
|
|||
permalink: '/blog/mdx-blog-post',
|
||||
locale: 'en',
|
||||
});
|
||||
expect(editUrlFunction).toHaveBeenCalledWith({
|
||||
blogDirPath: 'blog',
|
||||
blogPath: 'mdx-require-blog-post.mdx',
|
||||
permalink: '/blog/mdx-require-blog-post',
|
||||
locale: 'en',
|
||||
});
|
||||
expect(editUrlFunction).toHaveBeenCalledWith({
|
||||
blogDirPath: 'blog',
|
||||
blogPath: 'complex-slug.md',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue