From ed6d0aebe6ad61e6f64396de88f230c43dca419f Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 3 Jan 2018 18:01:46 +0200 Subject: [PATCH] Add TransactionPanel test: enquiry --- .../TransactionPanel/TransactionPanel.test.js | 30 + .../TransactionPanel.test.js.snap | 1582 +++++++++++++++++ 2 files changed, 1612 insertions(+) diff --git a/src/components/TransactionPanel/TransactionPanel.test.js b/src/components/TransactionPanel/TransactionPanel.test.js index d4b7633c..bd1a8fd0 100644 --- a/src/components/TransactionPanel/TransactionPanel.test.js +++ b/src/components/TransactionPanel/TransactionPanel.test.js @@ -31,6 +31,13 @@ describe('TransactionPanel - Sale', () => { customer: createUser('customer1'), lastTransitionedAt: new Date(Date.UTC(2017, 5, 10)), }; + + const txEnquired = createTransaction({ + id: 'sale-enquired', + lastTransition: propTypes.TX_TRANSITION_ENQUIRE, + ...baseTxAttrs, + }); + const txPreauthorized = createTransaction({ id: 'sale-preauthorized', lastTransition: propTypes.TX_TRANSITION_PREAUTHORIZE, @@ -93,6 +100,14 @@ describe('TransactionPanel - Sale', () => { intl: fakeIntl, }; + it('enquired matches snapshot', () => { + const props = { + ...panelBaseProps, + transaction: txEnquired, + }; + const tree = renderShallow(); + expect(tree).toMatchSnapshot(); + }); it('preauthorized matches snapshot', () => { const props = { ...panelBaseProps, @@ -182,6 +197,12 @@ describe('TransactionPanel - Order', () => { customer: createUser('customer'), }; + const txEnquired = createTransaction({ + id: 'order-enquired', + lastTransition: propTypes.TX_TRANSITION_ENQUIRE, + ...baseTxAttrs, + }); + const txPreauthorized = createTransaction({ id: 'order-preauthorized', lastTransition: propTypes.TX_TRANSITION_PREAUTHORIZE, @@ -244,6 +265,15 @@ describe('TransactionPanel - Order', () => { declineInProgress: false, }; + it('enquired matches snapshot', () => { + const props = { + ...panelBaseProps, + transaction: txEnquired, + }; + + const tree = renderShallow(); + expect(tree).toMatchSnapshot(); + }); it('preauthorized matches snapshot', () => { const props = { ...panelBaseProps, diff --git a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap index 19db7a76..a5a484d8 100644 --- a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap +++ b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap @@ -4125,6 +4125,831 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` `; +exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` +
+
+
+
+
+ +
+
+
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+
+ +
+
+
+ +
+`; + exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = `
`; +exports[`TransactionPanel - Sale enquired matches snapshot 1`] = ` +
+
+
+
+
+ +
+
+
+ +
+ + +
+ +
+ + +
+
+
+
+
+ +
+
+ +
+
+
+ +
+`; + exports[`TransactionPanel - Sale preauthorized matches snapshot 1`] = `