Skip to content

Commit

Permalink
Update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
poulch committed Dec 13, 2023
1 parent 2633d7a commit 0b79df6
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DiscountListUrlSortField } from "@dashboard/discounts/discountsUrls";
import { discountList } from "@dashboard/discounts/fixtures";
import {
filterPresetsProps,
pageListProps,
Expand All @@ -17,18 +18,18 @@ const props: DiscountListPageProps = {
...filterPresetsProps,
settings: {
...pageListProps.default.settings,
columns: ["name", "startDate", "endDate", "value"],
columns: ["name", "startDate", "endDate"],
},

promotions: [],
promotions: discountList,
sort: {
...sortPageProps.sort,
sort: DiscountListUrlSortField.name,
},
};

const meta: Meta<typeof DiscountListPage> = {
title: "Discounts / Sale list",
title: "Discounts / Discount list",
decorators: [PaginatorContextDecorator],
component: DiscountListPage,
};
Expand Down Expand Up @@ -64,14 +65,3 @@ export const NoData: Story = {
chromatic: { diffThreshold: 0.85 },
},
};

export const NoChannels: Story = {
args: {
...props,
// promotions: saleList.map(sale => ({ ...sale, channelListings: [] })),
promotions: [],
},
parameters: {
chromatic: { diffThreshold: 0.85 },
},
};
49 changes: 49 additions & 0 deletions src/discounts/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import placeholderImage from "@assets/images/placeholder60x60.png";
import {
DiscountValueTypeEnum,
PromotionDetailsFragment,
PromotionFragment,
RewardValueTypeEnum,
SaleDetailsFragment,
SaleFragment,
Expand Down Expand Up @@ -714,3 +715,51 @@ export const discount: PromotionDetailsFragment = {
},
],
};

export const discountList: PromotionFragment[] = [
{
__typename: "Promotion",
metadata: [],
privateMetadata: [],
id: "UHJvbW90aW9uOjNlYWM1OGMyLWU1OTEtNDI3OS05YzIwLWU3OTA0ZjhkYjhiZg==",
name: "Promo 1",
startDate: "2023-12-13T12:33:18.550840+00:00",
endDate: null,
},
{
__typename: "Promotion",
metadata: [],
privateMetadata: [],
id: "UHJvbW90aW9uOmM2NjgzOGUxLTViZGQtNDJiZC04YzIyLTQ0YzlmYTYxNGM5OA==",
name: "Promo 2",
startDate: "2024-01-08T23:00:00+00:00",
endDate: "2024-02-12T23:00:00+00:00",
},
{
__typename: "Promotion",
metadata: [],
privateMetadata: [],
id: "UHJvbW90aW9uOmQyMmQ3NDUyLTAzNDYtNDJiYS1iMmY4LTEzMjJlNDg4ZDIzZA==",
name: "Promo 3",
startDate: "2023-12-13T12:32:13.272371+00:00",
endDate: null,
},
{
__typename: "Promotion",
metadata: [],
privateMetadata: [],
id: "UHJvbW90aW9uOjk3ZDcxNDJjLWMyZjMtNDE5ZC1iNGM1LTUzNjBjNTNjYWM3Zg==",
name: "Promo 4",
startDate: "2023-12-13T15:18:22.922335+00:00",
endDate: null,
},
{
__typename: "Promotion",
metadata: [],
privateMetadata: [],
id: "UHJvbW90aW9uOjI2YzUzNmQ5LTNmNzctNDExYy1hYjRkLWNiMzgzMDJmYWExNw==",
name: "Promo 5",
startDate: "2023-12-31T23:00:00+00:00",
endDate: null,
},
];

0 comments on commit 0b79df6

Please sign in to comment.