diff --git a/src/apps/components/AppDetailsPage/AppDetailsPage.stories.tsx b/src/apps/components/AppDetailsPage/AppDetailsPage.stories.tsx index bbdf5e35d..5033092a1 100644 --- a/src/apps/components/AppDetailsPage/AppDetailsPage.stories.tsx +++ b/src/apps/components/AppDetailsPage/AppDetailsPage.stories.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { appDetails } from "../../fixtures"; import AppDetailsPage, { AppDetailsPageProps } from "./AppDetailsPage"; @@ -11,10 +11,28 @@ const props: AppDetailsPageProps = { onAppDeleteOpen: () => undefined, }; -export default { +const meta: Meta = { title: "Apps / App details", + component: AppDetailsPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; - -export const Loading = () => ; +export const Loading: Story = { + args: { + ...props, + loading: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/apps/components/AppListPage/AppListPage.stories.tsx b/src/apps/components/AppListPage/AppListPage.stories.tsx index 85f786d26..08a7c4de2 100644 --- a/src/apps/components/AppListPage/AppListPage.stories.tsx +++ b/src/apps/components/AppListPage/AppListPage.stories.tsx @@ -1,5 +1,5 @@ import { installedAppsList } from "@dashboard/apps/fixtures"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import AppListPage, { AppListPageProps } from "./AppListPage"; @@ -8,17 +8,30 @@ const props: AppListPageProps = { installedApps: installedAppsList, }; -export default { +const meta: Meta = { title: "Apps / New Apps / App List", + component: AppListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.9, pauseAnimationAtEnd: true }, + }, }; -export const Default = () => ; - -export const Empty = () => ( - -); +export const Empty: Story = { + args: { + ...props, + installedApps: [], + installableMarketplaceApps: [], + comingSoonMarketplaceApps: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx b/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx index 2779d4b8e..bc3128f6d 100644 --- a/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx +++ b/src/categories/components/CategoryListPage/CategoryListPage.stories.tsx @@ -7,7 +7,7 @@ import { sortPageProps, tabPageProps, } from "@dashboard/fixtures"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import CategoryListPage, { CategoryTableProps } from "./CategoryListPage"; @@ -26,17 +26,39 @@ const categoryTableProps: CategoryTableProps = { }, }; -export default { +const meta: Meta = { title: "Categories / Category list", decorators: [PaginatorContextDecorator], + component: CategoryListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...categoryTableProps, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...categoryTableProps, + categories: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); - -export const Empty = () => ( - -); +export const Empty: Story = { + args: { + ...categoryTableProps, + categories: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/channels/pages/ChannelsListPage/ChannelsListPage.stories.tsx b/src/channels/pages/ChannelsListPage/ChannelsListPage.stories.tsx index 193a94f56..003a2edaa 100644 --- a/src/channels/pages/ChannelsListPage/ChannelsListPage.stories.tsx +++ b/src/channels/pages/ChannelsListPage/ChannelsListPage.stories.tsx @@ -1,6 +1,6 @@ import { channelsList } from "@dashboard/channels/fixtures"; import { limits, limitsReached } from "@dashboard/fixtures"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import ChannelsListPage, { ChannelsListPageProps } from "./ChannelsListPage"; @@ -10,18 +10,48 @@ const props: ChannelsListPageProps = { onRemove: () => undefined, }; -export default { +const meta: Meta = { title: "Channels / Channels list", + component: ChannelsListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Empty: Story = { + args: { + ...props, + channelsList: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Empty = () => ; +export const NoLimits: Story = { + args: { + ...props, + limits: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoLimits = () => ( - -); - -export const LimitsReached = () => ( - -); +export const LimitsReached: Story = { + args: { + ...props, + limits: limitsReached, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/collections/components/CollectionListPage/CollectionListPage.stories.tsx b/src/collections/components/CollectionListPage/CollectionListPage.stories.tsx index eb5a6365c..e913b38ac 100644 --- a/src/collections/components/CollectionListPage/CollectionListPage.stories.tsx +++ b/src/collections/components/CollectionListPage/CollectionListPage.stories.tsx @@ -1,5 +1,5 @@ import { CollectionListUrlSortField } from "@dashboard/collections/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import CollectionListPage, { @@ -32,15 +32,41 @@ const props: CollectionListPageProps = { filterOpts: collectionListFilterOpts, }; -export default { +const meta: Meta = { title: "Collections / Collection list", decorators: [PaginatorContextDecorator], + component: CollectionListPage, }; -export const Default = () => ; +export default meta; +type Story = StoryObj; -export const Loading = () => ( - -); +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoData = () => ; +export const Loading: Story = { + args: { + ...props, + collections: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; + +export const NoData: Story = { + args: { + ...props, + collections: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx b/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx index 712b45d16..9e23915af 100644 --- a/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx +++ b/src/customers/components/CustomerListPage/CustomerListPage.stories.tsx @@ -6,6 +6,7 @@ import { sortPageProps, tabPageProps, } from "@dashboard/fixtures"; +import { Meta, StoryObj } from "@storybook/react"; import React from "react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; @@ -53,15 +54,40 @@ const CustomerListPage = props => ( ); -export default { +const meta: Meta = { title: "Customers / Customer list", decorators: [PaginatorContextDecorator], + component: CustomerListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + customers: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); - -export const NoData = () => ; +export const NoData: Story = { + args: { + ...props, + customers: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/discounts/components/SaleListPage/SaleListPage.stories.tsx b/src/discounts/components/SaleListPage/SaleListPage.stories.tsx index 0a76bec9d..b118bff29 100644 --- a/src/discounts/components/SaleListPage/SaleListPage.stories.tsx +++ b/src/discounts/components/SaleListPage/SaleListPage.stories.tsx @@ -8,7 +8,7 @@ import { tabPageProps, } from "@dashboard/fixtures"; import { DiscountStatusEnum, DiscountValueTypeEnum } from "@dashboard/graphql"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import SaleListPage, { SaleListPageProps } from "./SaleListPage"; @@ -54,21 +54,50 @@ const props: SaleListPageProps = { }, }; -export default { +const meta: Meta = { title: "Discounts / Sale list", decorators: [PaginatorContextDecorator], + component: SaleListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + sales: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ; +export const NoData: Story = { + args: { + ...props, + sales: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoData = () => ; - -export const NoChannels = () => ( - ({ ...sale, channelListings: [] }))} - selectedChannelId="" - /> -); +export const NoChannels: Story = { + args: { + ...props, + sales: saleList.map(sale => ({ ...sale, channelListings: [] })), + selectedChannelId: "", + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx b/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx index 0b63ede6f..664f200bf 100644 --- a/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx +++ b/src/discounts/components/VoucherListPage/VoucherListPage.stories.tsx @@ -9,7 +9,7 @@ import { tabPageProps, } from "@dashboard/fixtures"; import { DiscountStatusEnum, VoucherDiscountType } from "@dashboard/graphql"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import VoucherListPage, { VoucherListPageProps } from "./VoucherListPage"; @@ -63,24 +63,43 @@ const props: VoucherListPageProps = { vouchers: voucherList, }; -export default { +const meta: Meta = { title: "Discounts / Voucher list", decorators: [PaginatorContextDecorator], + component: VoucherListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + vouchers: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); - -export const NoChannels = () => ( - ({ +export const NoChannels: Story = { + args: { + ...props, + selectedChannelId: "", + vouchers: voucherList.map(voucher => ({ ...voucher, channelListings: [], - }))} - /> -); + })), + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx b/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx index 014b3b2c9..83b0b789c 100644 --- a/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx +++ b/src/orders/components/OrderDraftListPage/OrderDraftListPage.stories.tsx @@ -9,7 +9,7 @@ import { tabPageProps, } from "@dashboard/fixtures"; import { OrderDraftListUrlSortField } from "@dashboard/orders/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import { orders } from "../../fixtures"; @@ -46,19 +46,49 @@ const props: OrderDraftListPageProps = { }, }; -export default { +const meta: Meta = { title: "Orders / Draft order list", decorators: [PaginatorContextDecorator], + component: OrderDraftListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + orders: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); +export const WhenNoData: Story = { + args: { + ...props, + orders: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const WhenNoData = () => ; - -export const LimitsReached = () => ( - -); +export const LimitsReached: Story = { + args: { + ...props, + limits: limitsReached, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/orders/components/OrderListPage/OrderListPage.stories.tsx b/src/orders/components/OrderListPage/OrderListPage.stories.tsx index 492db2ed8..85e43dd85 100644 --- a/src/orders/components/OrderListPage/OrderListPage.stories.tsx +++ b/src/orders/components/OrderListPage/OrderListPage.stories.tsx @@ -9,7 +9,7 @@ import { import { OrderStatusFilter, PaymentChargeStatusEnum } from "@dashboard/graphql"; import { orders } from "@dashboard/orders/fixtures"; import { OrderListUrlSortField } from "@dashboard/orders/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import { OrderFilterGiftCard } from "./filters"; @@ -84,26 +84,61 @@ const props: OrderListPageProps = { onTabUpdate: () => undefined, }; -export default { +const meta: Meta = { title: "Orders / Order list", decorators: [PaginatorContextDecorator], + component: OrderListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + orders: undefined, + currentTab: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.9, pauseAnimationAtEnd: true }, + }, +}; -export const Loading = () => ( - -); +export const WhenNoData: Story = { + args: { + ...props, + orders: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const WhenNoData = () => ; +export const NoLimits: Story = { + args: { + ...props, + limits: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoLimits = () => ; - -export const LimitsReached = () => ( - -); +export const LimitsReached: Story = { + args: { + ...props, + limits: limitsReached, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/pageTypes/components/PageTypeListPage/PageTypeListPage.stories.tsx b/src/pageTypes/components/PageTypeListPage/PageTypeListPage.stories.tsx index dd39f674b..4cb69b256 100644 --- a/src/pageTypes/components/PageTypeListPage/PageTypeListPage.stories.tsx +++ b/src/pageTypes/components/PageTypeListPage/PageTypeListPage.stories.tsx @@ -6,7 +6,7 @@ import { tabPageProps, } from "@dashboard/fixtures"; import { PageTypeListUrlSortField } from "@dashboard/pageTypes/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import { pageTypes } from "../../fixtures"; @@ -25,15 +25,40 @@ const props: PageTypeListPageProps = { pageTypes, }; -export default { +const meta: Meta = { title: "Page types / Page types list", decorators: [PaginatorContextDecorator], + component: PageTypeListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + pageTypes: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); - -export const NoData = () => ; +export const NoData: Story = { + args: { + ...props, + pageTypes: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/pages/components/PageListPage/PageListPage.stories.tsx b/src/pages/components/PageListPage/PageListPage.stories.tsx index c1235c689..c8d571946 100644 --- a/src/pages/components/PageListPage/PageListPage.stories.tsx +++ b/src/pages/components/PageListPage/PageListPage.stories.tsx @@ -5,7 +5,7 @@ import { } from "@dashboard/fixtures"; import { pageList } from "@dashboard/pages/fixtures"; import { PageListUrlSortField } from "@dashboard/pages/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import PageListPage, { PageListPageProps } from "./PageListPage"; @@ -28,15 +28,40 @@ const props: PageListPageProps = { }, }; -export default { +const meta: Meta = { title: "Pages / Page list", decorators: [PaginatorContextDecorator], + component: PageListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + pages: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); - -export const NoData = () => ; +export const NoData: Story = { + args: { + ...props, + pages: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/plugins/components/PluginsListPage/PluginsListPage.stories.tsx b/src/plugins/components/PluginsListPage/PluginsListPage.stories.tsx index d99a8d402..af58349c8 100644 --- a/src/plugins/components/PluginsListPage/PluginsListPage.stories.tsx +++ b/src/plugins/components/PluginsListPage/PluginsListPage.stories.tsx @@ -6,7 +6,7 @@ import { import { PluginConfigurationType } from "@dashboard/graphql"; import { pluginList } from "@dashboard/plugins/fixtures"; import { PluginListUrlSortField } from "@dashboard/plugins/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import PluginsListPage, { PluginsListPageProps } from "./PluginsListPage"; @@ -47,9 +47,19 @@ const props: PluginsListPageProps = { }, }; -export default { +const meta: Meta = { title: "Plugins / Plugin list", decorators: [PaginatorContextDecorator], + component: PluginsListPage, }; +export default meta; +type Story = StoryObj; -export const Default = () => ; +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.stories.tsx b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.stories.tsx index ab0af40b0..38748d310 100644 --- a/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.stories.tsx +++ b/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.stories.tsx @@ -8,7 +8,7 @@ import { } from "@dashboard/fixtures"; import { ProductTypeConfigurable, ProductTypeEnum } from "@dashboard/graphql"; import { ProductTypeListUrlSortField } from "@dashboard/productTypes/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import { productTypes } from "../../fixtures"; @@ -40,17 +40,40 @@ const props: ProductTypeListPageProps = { productTypes, }; -export default { +const meta: Meta = { title: "Product types / Product types list", decorators: [PaginatorContextDecorator], + component: ProductTypeListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + productTypes: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); - -export const NoData = () => ( - -); +export const NoData: Story = { + args: { + ...props, + productTypes: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/products/components/ProductListPage/ProductListPage.stories.tsx b/src/products/components/ProductListPage/ProductListPage.stories.tsx index eecfc68ee..f38196769 100644 --- a/src/products/components/ProductListPage/ProductListPage.stories.tsx +++ b/src/products/components/ProductListPage/ProductListPage.stories.tsx @@ -14,7 +14,7 @@ import { ProductListUrlSortField } from "@dashboard/products/urls"; import { productListFilterOpts } from "@dashboard/products/views/ProductList/fixtures"; import { attributes } from "@dashboard/productTypes/fixtures"; import { ListViews } from "@dashboard/types"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import ProductListPage, { ProductListPageProps } from "./ProductListPage"; @@ -61,38 +61,85 @@ const props: ProductListPageProps = { }, }; -export default { +const meta: Meta = { title: "Products / Product list", decorators: [PaginatorContextDecorator], + component: ProductListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + products: undefined, + currentTab: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.9, pauseAnimationAtEnd: true }, + }, +}; -export const Loading = () => ( - -); +export const WithData: Story = { + args: { + ...props, + products, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const WithData = () => ( - -); +export const NoData: Story = { + args: { + ...props, + products: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoData = () => ; +export const NoChannels: Story = { + args: { + ...props, + selectedChannelId: "", + products: products.map(product => ({ + ...product, + channelListings: [], + })), + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoChannels = () => ( - ({ ...product, channelListings: [] }))} - /> -); +export const NoLimits: Story = { + args: { + ...props, + limits: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoLimits = () => ; - -export const LimitsReached = () => ( - -); +export const LimitsReached: Story = { + args: { + ...props, + limits: limitsReached, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/staff/components/StaffListPage/StaffListPage.stories.tsx b/src/staff/components/StaffListPage/StaffListPage.stories.tsx index f92628d5c..8e472c114 100644 --- a/src/staff/components/StaffListPage/StaffListPage.stories.tsx +++ b/src/staff/components/StaffListPage/StaffListPage.stories.tsx @@ -10,7 +10,7 @@ import { import { StaffMemberStatus } from "@dashboard/graphql"; import { staffMembers } from "@dashboard/staff/fixtures"; import { StaffListUrlSortField } from "@dashboard/staff/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import StaffListPage, { StaffListPageProps } from "./StaffListPage"; @@ -36,19 +36,50 @@ const props: StaffListPageProps = { staffMembers, }; -export default { +const meta: Meta = { title: "Staff / Staff members", decorators: [PaginatorContextDecorator], + component: StaffListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const WhenLoading: Story = { + args: { + ...props, + disabled: true, + staffMembers: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const WhenLoading = () => ( - -); +export const NoLimits: Story = { + args: { + ...props, + limits: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoLimits = () => ; - -export const LimitsReached = () => ( - -); +export const LimitsReached: Story = { + args: { + ...props, + limits: limitsReached, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx b/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx index e7611a0a2..7b01508de 100644 --- a/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx +++ b/src/translations/components/TranslationsEntitiesListPage/TranslationsEntitiesListPage.stories.tsx @@ -1,5 +1,6 @@ import { pageListProps, searchPageProps } from "@dashboard/fixtures"; import { LanguageCodeEnum } from "@dashboard/graphql"; +import { Meta, StoryObj } from "@storybook/react"; import React from "react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; @@ -31,12 +32,7 @@ const props: TranslationsEntitiesListPageProps = { }, }; -export default { - title: "Translations / Entity list", - decorators: [PaginatorContextDecorator], -}; - -export const Default = () => ( +const ListPage = props => ( ( /> ); + +const meta: Meta = { + title: "Translations / Entity list", + decorators: [PaginatorContextDecorator], + component: ListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; diff --git a/src/warehouses/components/WarehouseListPage/WarehouseListPage.stories.tsx b/src/warehouses/components/WarehouseListPage/WarehouseListPage.stories.tsx index 4865c4538..f3c0f32ea 100644 --- a/src/warehouses/components/WarehouseListPage/WarehouseListPage.stories.tsx +++ b/src/warehouses/components/WarehouseListPage/WarehouseListPage.stories.tsx @@ -7,7 +7,7 @@ import { tabPageProps, } from "@dashboard/fixtures"; import { WarehouseListUrlSortField } from "@dashboard/warehouses/urls"; -import React from "react"; +import { Meta, StoryObj } from "@storybook/react"; import { PaginatorContextDecorator } from "../../../../.storybook/decorators"; import { warehouseList } from "../../fixtures"; @@ -27,23 +27,61 @@ const props: WarehouseListPageProps = { warehouses: warehouseList, }; -export default { +const meta: Meta = { title: "Warehouses / Warehouse list", decorators: [PaginatorContextDecorator], + component: WarehouseListPage, +}; +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + ...props, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, }; -export const Default = () => ; +export const Loading: Story = { + args: { + ...props, + warehouses: undefined, + currentTab: undefined, + disabled: true, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const Loading = () => ( - -); +export const NoData: Story = { + args: { + ...props, + warehouses: [], + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoData = () => ; +export const NoLimits: Story = { + args: { + ...props, + limits: undefined, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +}; -export const NoLimits = () => ( - -); - -export const LimitsReached = () => ( - -); +export const LimitsReached: Story = { + args: { + ...props, + limits: limitsReached, + }, + parameters: { + chromatic: { diffThreshold: 0.85 }, + }, +};