fix FeaturedCreator stories

This commit is contained in:
Abhimanyu Yadav
2025-04-26 11:12:05 +05:30
parent 141384856d
commit b3d4d81f76
2 changed files with 10 additions and 14 deletions

View File

@@ -5,13 +5,13 @@ import { userEvent, within, expect } from "@storybook/test";
const meta = {
title: "AGPT UI/Composite/Featured Creators",
component: FeaturedCreators,
parameters: {
layout: {
center: true,
fullscreen: true,
padding: 0,
},
},
decorators: [
(Story) => (
<div className="flex items-center justify-center p-4">
<Story />
</div>
),
],
tags: ["autodocs"],
argTypes: {
featuredCreators: { control: "object" },
@@ -98,7 +98,6 @@ export const ManyCreators: Story = {
num_agents: 25,
},
],
// onCardClick: (creatorName) => console.log(`Clicked on ${creatorName}`),
},
};
@@ -109,13 +108,10 @@ export const WithInteraction: Story = {
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const creatorCards = canvas.getAllByRole("creator-card");
const creatorCards = canvas.getAllByTestId("creator-card");
const firstCreatorCard = creatorCards[0];
await userEvent.hover(firstCreatorCard);
await userEvent.click(firstCreatorCard);
// Check if the card has the expected hover and click effects
await expect(firstCreatorCard).toHaveClass("hover:shadow-lg");
},
};

View File

@@ -32,12 +32,12 @@ export const FeaturedCreators: React.FC<FeaturedCreatorsProps> = ({
return (
<div className="flex w-full flex-col items-center justify-center">
<div className="w-full max-w-[1360px]">
<div className="w-full">
<h2 className="mb-9 font-poppins text-lg font-semibold text-neutral-800 dark:text-neutral-200">
{title}
</h2>
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4">
<div className="flex flex-wrap gap-5">
{displayedCreators.map((creator, index) => (
<CreatorCard
key={index}