From 726389c941b3544bf928f6e96b98be380a3ede8a Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 28 Jan 2019 18:44:30 +0200 Subject: [PATCH] Update tests in TransactionPanel. --- .../TransactionPanel/TransactionPanel.test.js | 35 +++++++++++++++++++ .../TransactionPanel.test.js.snap | 30 ++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/src/components/TransactionPanel/TransactionPanel.test.js b/src/components/TransactionPanel/TransactionPanel.test.js index 58e83941..8f6b299a 100644 --- a/src/components/TransactionPanel/TransactionPanel.test.js +++ b/src/components/TransactionPanel/TransactionPanel.test.js @@ -2,6 +2,7 @@ import React from 'react'; import { shallow } from 'enzyme'; import { types as sdkTypes } from '../../util/sdkLoader'; import { + createTxTransition, createTransaction, createBooking, createListing, @@ -82,6 +83,23 @@ describe('TransactionPanel - Sale', () => { const txDelivered = createTransaction({ id: 'sale-delivered', lastTransition: TRANSITION_COMPLETE, + transitions: [ + createTxTransition({ + createdAt: new Date(Date.UTC(2017, 4, 1)), + by: 'customer', + transition: TRANSITION_REQUEST, + }), + createTxTransition({ + createdAt: new Date(Date.UTC(2017, 5, 1)), + by: 'provider', + transition: TRANSITION_ACCEPT, + }), + createTxTransition({ + createdAt: new Date(Date.UTC(2017, 6, 1)), + by: 'system', + transition: TRANSITION_COMPLETE, + }), + ], ...baseTxAttrs, }); @@ -250,6 +268,23 @@ describe('TransactionPanel - Order', () => { const txDelivered = createTransaction({ id: 'order-delivered', lastTransition: TRANSITION_COMPLETE, + transitions: [ + createTxTransition({ + createdAt: new Date(Date.UTC(2017, 4, 1)), + by: 'customer', + transition: TRANSITION_REQUEST, + }), + createTxTransition({ + createdAt: new Date(Date.UTC(2017, 5, 1)), + by: 'provider', + transition: TRANSITION_ACCEPT, + }), + createTxTransition({ + createdAt: new Date(Date.UTC(2017, 6, 1)), + by: 'system', + transition: TRANSITION_COMPLETE, + }), + ], ...baseTxAttrs, }); diff --git a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap index aaca233c..677dc392 100644 --- a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap +++ b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap @@ -2386,6 +2386,11 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` "createdAt": 2017-06-01T00:00:00.000Z, "transition": "transition/accept", }, + Object { + "by": "system", + "createdAt": 2017-07-01T00:00:00.000Z, + "transition": "transition/complete", + }, ], }, "booking": Object { @@ -2514,6 +2519,11 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` "createdAt": 2017-06-01T00:00:00.000Z, "transition": "transition/accept", }, + Object { + "by": "system", + "createdAt": 2017-07-01T00:00:00.000Z, + "transition": "transition/complete", + }, ], }, "booking": Object { @@ -2767,6 +2777,11 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` "createdAt": 2017-06-01T00:00:00.000Z, "transition": "transition/accept", }, + Object { + "by": "system", + "createdAt": 2017-07-01T00:00:00.000Z, + "transition": "transition/complete", + }, ], }, "booking": Object { @@ -6374,6 +6389,11 @@ exports[`TransactionPanel - Sale delivered matches snapshot 1`] = ` "createdAt": 2017-06-01T00:00:00.000Z, "transition": "transition/accept", }, + Object { + "by": "system", + "createdAt": 2017-07-01T00:00:00.000Z, + "transition": "transition/complete", + }, ], }, "booking": Object { @@ -6502,6 +6522,11 @@ exports[`TransactionPanel - Sale delivered matches snapshot 1`] = ` "createdAt": 2017-06-01T00:00:00.000Z, "transition": "transition/accept", }, + Object { + "by": "system", + "createdAt": 2017-07-01T00:00:00.000Z, + "transition": "transition/complete", + }, ], }, "booking": Object { @@ -6755,6 +6780,11 @@ exports[`TransactionPanel - Sale delivered matches snapshot 1`] = ` "createdAt": 2017-06-01T00:00:00.000Z, "transition": "transition/accept", }, + Object { + "by": "system", + "createdAt": 2017-07-01T00:00:00.000Z, + "transition": "transition/complete", + }, ], }, "booking": Object {