diff --git a/src/fixtures.ts b/src/fixtures.ts index e0c4676db..d76e1d667 100644 --- a/src/fixtures.ts +++ b/src/fixtures.ts @@ -5,6 +5,7 @@ import { ListActions, PageListProps, SearchPageProps, + SortPage, TabPageProps } from "./types"; @@ -141,3 +142,10 @@ export const fetchMoreProps: FetchMoreProps = { loading: false, onFetchMore: () => undefined }; + +export const sortPageProps: SortPage = { + onSort: () => undefined, + sort: { + asc: true + } +}; diff --git a/src/storybook/stories/products/ProductListPage.tsx b/src/storybook/stories/products/ProductListPage.tsx index d5f792e97..f9203dac4 100644 --- a/src/storybook/stories/products/ProductListPage.tsx +++ b/src/storybook/stories/products/ProductListPage.tsx @@ -4,6 +4,7 @@ import React from "react"; import placeholderImage from "@assets/images/placeholder255x255.png"; import { defaultListSettings } from "@saleor/config"; import { products as productListFixture } from "@saleor/products/fixtures"; +import { ProductListUrlSortField } from "@saleor/products/urls"; import { attributes } from "@saleor/productTypes/fixtures"; import { ListViews } from "@saleor/types"; import { @@ -11,7 +12,8 @@ import { filterPageProps, filters, listActionsProps, - pageListProps + pageListProps, + sortPageProps } from "../../../fixtures"; import ProductListPage, { ProductListPageProps @@ -25,6 +27,13 @@ const props: ProductListPageProps = { ...pageListProps.default, ...filterPageProps, ...fetchMoreProps, + ...{ + ...sortPageProps, + sort: { + ...sortPageProps.sort, + sort: ProductListUrlSortField.name + } + }, availableInGridAttributes: attributes, defaultSettings: defaultListSettings[ListViews.PRODUCT_LIST], gridAttributes: attributes,