Update storybook and tests

This commit is contained in:
adilallo
2025-09-30 10:42:35 -06:00
parent febf04b059
commit b15f913a14
8 changed files with 228 additions and 77 deletions
+33 -1
View File
@@ -8,6 +8,13 @@ const mockBlogPost = {
"This is a sample article description that explains what the article covers.",
author: "Sample Author",
date: "2025-01-15",
thumbnail: {
horizontal: "resolving-active-conflicts-horizontal.svg",
vertical: "resolving-active-conflicts-vertical.svg",
},
banner: {
horizontal: "resolving-active-conflicts-banner.svg",
},
},
htmlContent:
"<p>This is the main content of the sample article.</p><p>It has multiple paragraphs.</p>",
@@ -20,7 +27,7 @@ export default {
docs: {
description: {
component:
"The ContentBanner component displays the header information for blog articles, including title, description, author, and date. Note: page background colors are applied at the blog page level using a hex color from frontmatter (background.color), not inside this component. Thumbnail images should be uploaded via the content pipeline to public/content/blog/ and referenced in frontmatter (thumbnail.horizontal / thumbnail.vertical).",
"The ContentBanner component displays the header information for blog articles, including title, description, author, and date.\n\nImages: sm uses thumbnail.horizontal; md+ uses banner.horizontal when provided, otherwise falls back to thumbnail.horizontal; final fallback is assets/Content_Banner_2.svg.\n\nNote: page background colors are applied at the blog page level using a hex color from frontmatter (background.color), not inside this component. Thumbnail and banner images should be uploaded via the content pipeline to public/content/blog/ and referenced in frontmatter.",
},
},
},
@@ -38,6 +45,31 @@ export const Default = {
},
};
export const NoBannerFallbackToThumbnail = {
args: {
post: {
...mockBlogPost,
frontmatter: {
...mockBlogPost.frontmatter,
banner: undefined,
},
},
},
};
export const NoImagesFallbackToDefault = {
args: {
post: {
...mockBlogPost,
frontmatter: {
...mockBlogPost.frontmatter,
thumbnail: undefined,
banner: undefined,
},
},
},
};
export const LongTitle = {
args: {
post: {