From 80ace6e4350ac960ae847f11aaecaa2d8f221428 Mon Sep 17 00:00:00 2001 From: Dawid Tarasiuk Date: Tue, 23 Jun 2020 15:52:43 +0200 Subject: [PATCH] Update test snapshots --- src/orders/fixtures.ts | 3 + .../__snapshots__/Stories.test.ts.snap | 1210 ++++++++++++++++- .../stories/orders/OrderDetailsPage.tsx | 36 +- 3 files changed, 1179 insertions(+), 70 deletions(-) diff --git a/src/orders/fixtures.ts b/src/orders/fixtures.ts index f81980174..43f0fe041 100644 --- a/src/orders/fixtures.ts +++ b/src/orders/fixtures.ts @@ -5,6 +5,7 @@ import { MessageDescriptor } from "react-intl"; import { transformOrderStatus, transformPaymentStatus } from "../misc"; import { FulfillmentStatus, + JobStatusEnum, OrderAction, OrderEventsEnum, OrderStatus, @@ -920,6 +921,7 @@ export const order = (placeholder: string): OrderDetails_order => ({ createdAt: "2020-06-22T13:52:05.094636+00:00", id: "SW52b2ljZTox", number: "1", + status: JobStatusEnum.SUCCESS, url: "invoice1", }, ], @@ -1061,6 +1063,7 @@ export const draftOrder = (placeholder: string): OrderDetails_order => ({ createdAt: "2020-06-22T13:52:05.094636+00:00", id: "SW52b2ljZTox", number: "1", + status: JobStatusEnum.SUCCESS, url: "invoice1", }, ], diff --git a/src/storybook/__snapshots__/Stories.test.ts.snap b/src/storybook/__snapshots__/Stories.test.ts.snap index ad7520ba2..898570aa9 100644 --- a/src/storybook/__snapshots__/Stories.test.ts.snap +++ b/src/storybook/__snapshots__/Stories.test.ts.snap @@ -66959,7 +66959,19 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -68022,7 +68106,19 @@ exports[`Storyshots Views / Orders / Order details default 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -69115,7 +69283,19 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -69751,7 +70003,19 @@ exports[`Storyshots Views / Orders / Order details loading 1`] = `
+ > + +
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -71920,7 +72268,19 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -73013,7 +73445,19 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -74106,7 +74622,19 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -75199,7 +75799,19 @@ exports[`Storyshots Views / Orders / Order details payment confirmed 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -76292,7 +76976,19 @@ exports[`Storyshots Views / Orders / Order details payment error 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -77385,7 +78153,19 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -78478,7 +79330,19 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -79571,7 +80507,19 @@ exports[`Storyshots Views / Orders / Order details rejected payment 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
@@ -80664,7 +81684,19 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = `
+ > + +
- No invoices to be shown + + + + + + + + + + + + + +
+
+
+ Invoice no +
+
+
+
+
+ Action +
+
+
+ Invoice 1 +
+ created Jun 22, 2020 +
+
+ +
diff --git a/src/storybook/stories/orders/OrderDetailsPage.tsx b/src/storybook/stories/orders/OrderDetailsPage.tsx index b73fd5c4e..b7cd3e30d 100644 --- a/src/storybook/stories/orders/OrderDetailsPage.tsx +++ b/src/storybook/stories/orders/OrderDetailsPage.tsx @@ -5,13 +5,13 @@ import { storiesOf } from "@storybook/react"; import React from "react"; import OrderDetailsPage, { - OrderDetailsPageProps + OrderDetailsPageProps, } from "../../../orders/components/OrderDetailsPage"; import { countries, order as orderFixture } from "../../../orders/fixtures"; import { FulfillmentStatus, OrderStatus, - PaymentChargeStatusEnum + PaymentChargeStatusEnum, } from "../../../types/globalTypes"; import Decorator from "../../Decorator"; @@ -25,6 +25,8 @@ const props: Omit = { onFulfillmentCancel: () => undefined, onFulfillmentTrackingNumberUpdate: () => undefined, onInvoiceClick: () => undefined, + onInvoiceGenerate: () => undefined, + onInvoiceSend: () => undefined, onNoteAdd: undefined, onOrderCancel: undefined, onOrderFulfill: undefined, @@ -36,7 +38,7 @@ const props: Omit = { onProfileView: () => undefined, onShippingAddressEdit: undefined, order, - userPermissions: adminUserPermissions + userPermissions: adminUserPermissions, }; storiesOf("Views / Orders / Order details", module) @@ -48,7 +50,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED + paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED, }} /> )) @@ -57,7 +59,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED + paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED, }} /> )) @@ -66,7 +68,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - paymentStatus: PaymentChargeStatusEnum.FULLY_CHARGED + paymentStatus: PaymentChargeStatusEnum.FULLY_CHARGED, }} /> )) @@ -75,7 +77,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - paymentStatus: null + paymentStatus: null, }} /> )) @@ -84,7 +86,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - paymentStatus: PaymentChargeStatusEnum.FULLY_REFUNDED + paymentStatus: PaymentChargeStatusEnum.FULLY_REFUNDED, }} /> )) @@ -93,7 +95,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED + paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED, }} /> )) @@ -102,11 +104,11 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - fulfillments: props.order.fulfillments.map(fulfillment => ({ + fulfillments: props.order.fulfillments.map((fulfillment) => ({ ...fulfillment, - status: FulfillmentStatus.CANCELED + status: FulfillmentStatus.CANCELED, })), - status: OrderStatus.CANCELED + status: OrderStatus.CANCELED, }} /> )) @@ -115,7 +117,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - status: OrderStatus.FULFILLED + status: OrderStatus.FULFILLED, }} /> )) @@ -124,7 +126,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - status: OrderStatus.PARTIALLY_FULFILLED + status: OrderStatus.PARTIALLY_FULFILLED, }} /> )) @@ -133,7 +135,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - status: OrderStatus.UNFULFILLED + status: OrderStatus.UNFULFILLED, }} /> )) @@ -142,7 +144,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - shippingAddress: null + shippingAddress: null, }} /> )) @@ -151,7 +153,7 @@ storiesOf("Views / Orders / Order details", module) {...props} order={{ ...props.order, - customerNote: "" + customerNote: "", }} /> ));