From 268906aee3b3137b596b76df082f7378b7836f2f Mon Sep 17 00:00:00 2001 From: ozakione <29860391+OzakIOne@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:34:43 +0200 Subject: [PATCH] fix test --- .../__tests__/__snapshots__/feed.test.ts.snap | 427 +++++++++++++++++- .../src/__tests__/feed.test.ts | 2 + 2 files changed, 427 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap index 92390ff1a966..de5e3b131595 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/__snapshots__/feed.test.ts.snap @@ -627,7 +627,150 @@ exports[`atom has feed item for each post 1`] = ` exports[`atom has xslt files for feed 1`] = ` [ - " + " + + + + + + + + Atom Feed | <xsl:value-of select="atom:feed/atom:title" /> + + + +
+
+
+ This is an Atom feed. Subscribe by copying the URL from the address + bar into your newsreader. Visit About Feeds to learn more + and get started. It’s free.
+

+
+ + + + + + + + + + +
+ Custom Atom Feed Preview

+

+ +

+

Description:

+
+

Recent Posts

+
+ +
+ + + +
Published on +
+
+ +
+
+
+
+
+ + +
+ +
+", + "/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +* { + color: #0d1137; +} + +main { + flex: 1 0 auto; + width: 100%; + margin: 4rem auto; + padding: 1.5 rem; + max-width: 800px; + /* stylelint-disable-next-line font-family-name-quotes */ + font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; +} + +.info { + display: block; + margin: 3rem 0; + padding: 2rem 3rem; + border: 1px solid dodgerblue; + border-left-width: 0.5rem; + border-radius: 0.4rem; + background-color: #edf5ff; +} + +.rss-icon { + height: 3.8rem; + width: 3.8rem; + margin-right: 1rem; +} + +.flex { + display: flex; +} + +.items-start { + align-items: flex-start; +} + +.pb-7 { + padding-bottom: 3rem; +} + +a { + color: #005aff; + text-decoration: none; +} + +h1 { + text-wrap: balance; + font-size: 3.8rem; + line-height: 1; + font-weight: 800; + margin-bottom: 4rem; +} + +h2 { + font-size: 3rem; + line-height: 1.2; + font-weight: 700; + margin-bottom: 3rem; +} + +h2:not(:first-child) { + margin-top: 5.8rem; +} + +.italic { + font-style: italic; +} +", + " https://docusaurus.io/myBaseUrl/blog Hello Blog @@ -1259,6 +1402,146 @@ exports[`json has feed item for each post 1`] = ` exports[`json has xslt files for feed 1`] = ` [ + " + + + + + + + + RSS Feed | <xsl:value-of select="rss/channel/title" /> + + + +
+
+
+ This is an RSS feed. Subscribe by copying the URL from the address + bar into your newsreader. Visit About Feeds to learn more + and get started. It’s free.
+

+
+ + + + + + + + + + +
+ RSS Feed Preview

+

+ +

+

Description:

+
+

Recent Posts

+
+ +
+ + + +
Published on +
+
+ +
+
+
+
+
+ + +
+ +
+", + "/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +main { + flex: 1 0 auto; + width: 100%; + margin: 4rem auto; + padding: 1.5 rem; + max-width: 800px; + /* stylelint-disable-next-line font-family-name-quotes */ + font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; +} + +.info { + display: block; + margin: 3rem 0; + padding: 2rem 3rem; + border: 1px solid dodgerblue; + border-left-width: 0.5rem; + border-radius: 0.4rem; + background-color: #edf5ff; +} + +.rss-icon { + height: 3.8rem; + width: 3.8rem; + margin-right: 1rem; +} + +.flex { + display: flex; +} + +.items-start { + align-items: flex-start; +} + +.pb-7 { + padding-bottom: 3rem; +} + +a { + color: #005aff; + text-decoration: none; +} + +h1 { + text-wrap: balance; + font-size: 3.8rem; + line-height: 1; + font-weight: 800; + margin-bottom: 4rem; +} + +h2 { + font-size: 3rem; + line-height: 1.2; + font-weight: 700; + margin-bottom: 3rem; +} + +h2:not(:first-child) { + margin-top: 5.8rem; +} + +.italic { + font-style: italic; +} +", "{ "version": "https://jsonfeed.org/version/1", "title": "Hello Blog", @@ -1963,7 +2246,147 @@ exports[`rss has feed item for each post 1`] = ` exports[`rss has xslt files for feed 1`] = ` [ - " + " + + + + + + + + RSS Feed | <xsl:value-of select="rss/channel/title" /> + + + +
+
+
+ This is an RSS feed. Subscribe by copying the URL from the address + bar into your newsreader. Visit About Feeds to learn more + and get started. It’s free.
+

+
+ + + + + + + + + + +
+ RSS Feed Preview

+

+ +

+

Description:

+
+

Recent Posts

+
+ +
+ + + +
Published on +
+
+ +
+
+
+
+
+ + +
+ +
+", + "/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +main { + flex: 1 0 auto; + width: 100%; + margin: 4rem auto; + padding: 1.5 rem; + max-width: 800px; + /* stylelint-disable-next-line font-family-name-quotes */ + font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; +} + +.info { + display: block; + margin: 3rem 0; + padding: 2rem 3rem; + border: 1px solid dodgerblue; + border-left-width: 0.5rem; + border-radius: 0.4rem; + background-color: #edf5ff; +} + +.rss-icon { + height: 3.8rem; + width: 3.8rem; + margin-right: 1rem; +} + +.flex { + display: flex; +} + +.items-start { + align-items: flex-start; +} + +.pb-7 { + padding-bottom: 3rem; +} + +a { + color: #005aff; + text-decoration: none; +} + +h1 { + text-wrap: balance; + font-size: 3.8rem; + line-height: 1; + font-weight: 800; + margin-bottom: 4rem; +} + +h2 { + font-size: 3rem; + line-height: 1.2; + font-weight: 700; + margin-bottom: 3rem; +} + +h2:not(:first-child) { + margin-top: 5.8rem; +} + +.italic { + font-style: italic; +} +", + " Hello Blog diff --git a/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts b/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts index 6ef2f9e14334..3c9c1332b6fd 100644 --- a/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts +++ b/packages/docusaurus-plugin-content-blog/src/__tests__/feed.test.ts @@ -330,6 +330,8 @@ describe.each(['atom', 'rss', 'json'])('%s', (feedType) => { type: [feedType], copyright: 'Copyright', xslt: true, + rssXslt: 'rss.xslt', + atomXslt: 'atom.xslt', }, readingTime: ({content, defaultReadingTime}) => defaultReadingTime({content}),