Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Update fixtures

dominik-zeglen15ad9d166974
diff --git a/saleor/static/dashboard-next/orders/fixtures.ts b/saleor/static/dashboard-next/orders/fixtures.ts
index 50edea3aff..dcd8aef713 100644
--- a/saleor/static/dashboard-next/orders/fixtures.ts
+++ b/saleor/static/dashboard-next/orders/fixtures.ts
@@ -1131,3 +1131,69 @@ export const shippingMethods = [
{ id: "s1", name: "DHL", country: "whole world", price: {} },
{ id: "s2", name: "UPS", country: "Afghanistan" }
];
+export const orderLineSearch = (placeholderImage: string) => [
+ {
+ __typename: "Product" as "Product",
+ id: "UHJvZHVjdDo3Mg==",
+ name: "Apple Juice",
+ thumbnail: {
+ __typename: "Image" as "Image",
+ url: placeholderImage
+ },
+ variants: [
+ {
+ __typename: "ProductVariant" as "ProductVariant",
+ id: "UHJvZHVjdFZhcmlhbnQ6MjAy",
+ name: "500ml",
+ price: { amount: 3.0, currency: "USD", __typename: "Money" as "Money" },
+ sku: "93855755"
+ },
+ {
+ __typename: "ProductVariant" as "ProductVariant",
+ id: "UHJvZHVjdFZhcmlhbnQ6MjAz",
+ name: "1l",
+ price: { amount: 5.0, currency: "USD", __typename: "Money" as "Money" },
+ sku: "43226647"
+ },
+ {
+ __typename: "ProductVariant" as "ProductVariant",
+ id: "UHJvZHVjdFZhcmlhbnQ6MjA0",
+ name: "2l",
+ price: { amount: 7.0, currency: "USD", __typename: "Money" as "Money" },
+ sku: "80884671"
+ }
+ ]
+ },
+ {
+ __typename: "Product" as "Product",
+ id: "UHJvZHVjdDo3NQ==",
+ name: "Pineapple Juice",
+ thumbnail: {
+ __typename: "Image" as "Image",
+ url: placeholderImage
+ },
+ variants: [
+ {
+ __typename: "ProductVariant" as "ProductVariant",
+ id: "UHJvZHVjdFZhcmlhbnQ6MjEx",
+ name: "500ml",
+ price: { amount: 3.0, currency: "USD", __typename: "Money" as "Money" },
+ sku: "43200242"
+ },
+ {
+ __typename: "ProductVariant" as "ProductVariant",
+ id: "UHJvZHVjdFZhcmlhbnQ6MjEy",
+ name: "1l",
+ price: { amount: 5.0, currency: "USD", __typename: "Money" as "Money" },
+ sku: "79129513"
+ },
+ {
+ __typename: "ProductVariant" as "ProductVariant",
+ id: "UHJvZHVjdFZhcmlhbnQ6MjEz",
+ name: "2l",
+ price: { amount: 7.0, currency: "USD", __typename: "Money" as "Money" },
+ sku: "75799450"
+ }
+ ]
+ }
+];
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderDraftPage.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderDraftPage.tsx
index 7b06998b8b..8bea0d8d7b 100644
--- a/saleor/static/dashboard-next/storybook/stories/orders/OrderDraftPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderDraftPage.tsx
@@ -6,12 +6,7 @@ import * as placeholderImage from "../../../../images/placeholder60x60.png";
import OrderDraftPage, {
OrderDraftPageProps
} from "../../../orders/components/OrderDraftPage";
-import {
- clients,
- countries,
- draftOrder,
- variants
-} from "../../../orders/fixtures";
+import { clients, countries, draftOrder } from "../../../orders/fixtures";
import Decorator from "../../Decorator";
const order = draftOrder(placeholderImage);
@@ -20,7 +15,6 @@ const props: Omit<OrderDraftPageProps, "classes"> = {
countries,
disabled: false,
fetchUsers: () => undefined,
- fetchVariants: () => undefined,
onBack: () => undefined,
onBillingAddressEdit: undefined,
onCustomerEdit: () => undefined,
@@ -36,9 +30,7 @@ const props: Omit<OrderDraftPageProps, "classes"> = {
order,
saveButtonBarState: "default",
users: clients,
- usersLoading: false,
- variants,
- variantsLoading: false
+ usersLoading: false
};
storiesOf("Views / Orders / Order draft", module)
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx
index 980499c86c..8ef44c1a62 100644
--- a/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderProductAddDialog.tsx
@@ -1,8 +1,9 @@
import { storiesOf } from "@storybook/react";
import * as React from "react";
+import * as placeholderImage from "../../../../images/placeholder60x60.png";
import OrderProductAddDialog from "../../../orders/components/OrderProductAddDialog";
-import { variants } from "../../../orders/fixtures";
+import { orderLineSearch } from "../../../orders/fixtures";
import Decorator from "../../Decorator";
storiesOf("Orders / OrderProductAddDialog", module)
@@ -13,8 +14,10 @@ storiesOf("Orders / OrderProductAddDialog", module)
loading={false}
open={true}
onClose={undefined}
- variants={variants}
- fetchVariants={undefined}
onSubmit={undefined}
+ hasMore={false}
+ onFetch={() => undefined}
+ onFetchMore={() => undefined}
+ products={orderLineSearch(placeholderImage)}
/>
));