Files
community-rule/stories/ContentThumbnailTemplate.stories.js
T
adilallo e6f29a2d97
CI Pipeline / test (20) (pull_request) Successful in 2m28s
CI Pipeline / test (18) (pull_request) Successful in 2m36s
CI Pipeline / e2e (chromium) (pull_request) Successful in 3m41s
CI Pipeline / e2e (firefox) (pull_request) Successful in 3m55s
CI Pipeline / e2e (webkit) (pull_request) Successful in 4m10s
CI Pipeline / visual-regression (pull_request) Failing after 4m25s
CI Pipeline / storybook (pull_request) Successful in 1m33s
CI Pipeline / performance (pull_request) Successful in 2m31s
CI Pipeline / lint (pull_request) Successful in 1m2s
CI Pipeline / build (pull_request) Successful in 1m28s
Fix failing tests
2025-09-13 17:34:12 -06:00

91 lines
2.1 KiB
JavaScript

import ContentThumbnailTemplate from "../app/components/ContentThumbnailTemplate";
const mockPost = {
slug: "sample-article",
frontmatter: {
title: "Sample Article Title",
description:
"This is a sample article description that explains what the article covers.",
author: "Sample Author",
date: "2025-01-15",
},
};
const mockSlugOrder = ["sample-article", "another-article", "third-article"];
export default {
title: "Components/ContentThumbnailTemplate",
component: ContentThumbnailTemplate,
parameters: {
docs: {
description: {
component:
"The ContentThumbnailTemplate component displays blog post previews with background images, content, and metadata in both vertical and horizontal layouts.",
},
},
},
argTypes: {
post: {
control: "object",
description: "Blog post object with frontmatter",
},
slugOrder: {
control: "object",
description: "Array of slugs for consistent background cycling",
},
variant: {
control: { type: "select" },
options: ["vertical", "horizontal"],
description: "Layout variant for the thumbnail",
},
},
};
export const Vertical = {
args: {
post: mockPost,
slugOrder: mockSlugOrder,
variant: "vertical",
},
};
export const Horizontal = {
args: {
post: mockPost,
slugOrder: mockSlugOrder,
variant: "horizontal",
},
};
export const SecondStyle = {
args: {
post: { ...mockPost, slug: "another-article" },
slugOrder: mockSlugOrder,
variant: "vertical",
},
};
export const ThirdStyle = {
args: {
post: { ...mockPost, slug: "third-article" },
slugOrder: mockSlugOrder,
variant: "vertical",
},
};
export const LongContent = {
args: {
post: {
...mockPost,
frontmatter: {
...mockPost.frontmatter,
title: "This is a Very Long Article Title That Tests Text Wrapping",
description:
"This is a longer description that tests how the component handles extended text content and ensures proper wrapping and display within the thumbnail.",
},
},
slugOrder: mockSlugOrder,
variant: "vertical",
},
};