mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix FeaturedCreator stories
This commit is contained in:
@@ -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");
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user