From 3ff963192afe3dc178ad5f3a5edbb65c1ff2d480 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Mon, 25 Mar 2019 14:38:24 +0200 Subject: [PATCH] Update tests --- .../TransactionPanel/TransactionPanel.test.js | 34 ++++++-- .../TransactionPanel.test.js.snap | 84 +++++++++++++++++++ src/containers/InboxPage/InboxPage.test.js | 19 ++++- .../__snapshots__/InboxPage.test.js.snap | 8 ++ .../TransactionPage/TransactionPage.test.js | 17 +++- .../TransactionPage.test.js.snap | 4 + 6 files changed, 150 insertions(+), 16 deletions(-) diff --git a/src/components/TransactionPanel/TransactionPanel.test.js b/src/components/TransactionPanel/TransactionPanel.test.js index d4458272..aeff930e 100644 --- a/src/components/TransactionPanel/TransactionPanel.test.js +++ b/src/components/TransactionPanel/TransactionPanel.test.js @@ -31,12 +31,17 @@ const { Money } = sdkTypes; describe('TransactionPanel - Sale', () => { const providerId = 'provider'; const customerId = 'customer'; + const start = new Date(Date.UTC(2017, 5, 10)); + const end = new Date(Date.UTC(2017, 5, 13)); + const baseTxAttrs = { total: new Money(16500, 'USD'), commission: new Money(1000, 'USD'), booking: createBooking('booking1', { - start: new Date(Date.UTC(2017, 5, 10)), - end: new Date(Date.UTC(2017, 5, 13)), + start, + end, + displayStart: start, + displayEnd: end, }), listing: createListing('listing1'), customer: createUser(customerId), @@ -187,14 +192,19 @@ describe('TransactionPanel - Sale', () => { expect(tree).toMatchSnapshot(); }); it('renders correct total price', () => { + const start = new Date(Date.UTC(2017, 5, 10)); + const end = new Date(Date.UTC(2017, 5, 13)); + const transaction = createTransaction({ id: 'sale-tx', lastTransition: TRANSITION_REQUEST, total: new Money(16500, 'USD'), commission: new Money(1000, 'USD'), booking: createBooking('booking1', { - start: new Date(Date.UTC(2017, 5, 10)), - end: new Date(Date.UTC(2017, 5, 13)), + start, + end, + displayStart: start, + displayEnd: end, }), listing: createListing('listing1'), customer: createUser('customer1'), @@ -219,11 +229,15 @@ describe('TransactionPanel - Sale', () => { describe('TransactionPanel - Order', () => { const providerId = 'provider'; const customerId = 'customer'; + const start = new Date(Date.UTC(2017, 5, 10)); + const end = new Date(Date.UTC(2017, 5, 13)); const baseTxAttrs = { total: new Money(16500, 'USD'), booking: createBooking('booking1', { - start: new Date(Date.UTC(2017, 5, 10)), - end: new Date(Date.UTC(2017, 5, 13)), + start, + end, + displayStart: start, + displayEnd: end, }), listing: createListing('listing1'), provider: createUser(providerId), @@ -375,13 +389,17 @@ describe('TransactionPanel - Order', () => { expect(tree).toMatchSnapshot(); }); it('renders correct total price', () => { + const start = new Date(Date.UTC(2017, 5, 10)); + const end = new Date(Date.UTC(2017, 5, 13)); const tx = createTransaction({ id: 'order-tx', lastTransition: TRANSITION_REQUEST, total: new Money(16500, 'USD'), booking: createBooking('booking1', { - start: new Date(Date.UTC(2017, 5, 10)), - end: new Date(Date.UTC(2017, 5, 13)), + start, + end, + displayStart: start, + displayEnd: end, }), listing: createListing('listing1'), provider: createUser(providerId), diff --git a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap index 85e0a309..9ba55f5d 100644 --- a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap +++ b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap @@ -181,6 +181,8 @@ exports[`TransactionPanel - Order accepted matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -311,6 +313,8 @@ exports[`TransactionPanel - Order accepted matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -570,6 +574,8 @@ exports[`TransactionPanel - Order accepted matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -867,6 +873,8 @@ exports[`TransactionPanel - Order autodeclined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -997,6 +1005,8 @@ exports[`TransactionPanel - Order autodeclined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -1255,6 +1265,8 @@ exports[`TransactionPanel - Order autodeclined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -1553,6 +1565,8 @@ exports[`TransactionPanel - Order canceled matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -1683,6 +1697,8 @@ exports[`TransactionPanel - Order canceled matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -1942,6 +1958,8 @@ exports[`TransactionPanel - Order canceled matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -2239,6 +2257,8 @@ exports[`TransactionPanel - Order declined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -2369,6 +2389,8 @@ exports[`TransactionPanel - Order declined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -2627,6 +2649,8 @@ exports[`TransactionPanel - Order declined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -2930,6 +2954,8 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -3065,6 +3091,8 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -3329,6 +3357,8 @@ exports[`TransactionPanel - Order delivered matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -3626,6 +3656,8 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -3756,6 +3788,8 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -4013,6 +4047,8 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -4310,6 +4346,8 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -4440,6 +4478,8 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -4698,6 +4738,8 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -4996,6 +5038,8 @@ exports[`TransactionPanel - Sale accepted matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -5126,6 +5170,8 @@ exports[`TransactionPanel - Sale accepted matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -5385,6 +5431,8 @@ exports[`TransactionPanel - Sale accepted matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -5682,6 +5730,8 @@ exports[`TransactionPanel - Sale autodeclined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -5812,6 +5862,8 @@ exports[`TransactionPanel - Sale autodeclined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -6070,6 +6122,8 @@ exports[`TransactionPanel - Sale autodeclined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -6368,6 +6422,8 @@ exports[`TransactionPanel - Sale canceled matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -6498,6 +6554,8 @@ exports[`TransactionPanel - Sale canceled matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -6757,6 +6815,8 @@ exports[`TransactionPanel - Sale canceled matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -7054,6 +7114,8 @@ exports[`TransactionPanel - Sale declined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -7184,6 +7246,8 @@ exports[`TransactionPanel - Sale declined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -7442,6 +7506,8 @@ exports[`TransactionPanel - Sale declined matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -7745,6 +7811,8 @@ exports[`TransactionPanel - Sale delivered matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -7880,6 +7948,8 @@ exports[`TransactionPanel - Sale delivered matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -8144,6 +8214,8 @@ exports[`TransactionPanel - Sale delivered matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -8441,6 +8513,8 @@ exports[`TransactionPanel - Sale enquired matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -8571,6 +8645,8 @@ exports[`TransactionPanel - Sale enquired matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -8828,6 +8904,8 @@ exports[`TransactionPanel - Sale enquired matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -9125,6 +9203,8 @@ exports[`TransactionPanel - Sale preauthorized matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -9255,6 +9335,8 @@ exports[`TransactionPanel - Sale preauthorized matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -9513,6 +9595,8 @@ exports[`TransactionPanel - Sale preauthorized matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, diff --git a/src/containers/InboxPage/InboxPage.test.js b/src/containers/InboxPage/InboxPage.test.js index f3eef444..82074698 100644 --- a/src/containers/InboxPage/InboxPage.test.js +++ b/src/containers/InboxPage/InboxPage.test.js @@ -22,13 +22,24 @@ describe('InboxPage', () => { const currentUserProvider = createCurrentUser('provider-user-id'); const currentUserCustomer = createCurrentUser('customer-user-id'); + const startBooking1 = new Date(Date.UTC(2017, 1, 15)); + const endBooking1 = new Date(Date.UTC(2017, 1, 16)); + const booking1 = createBooking('booking1', { - start: new Date(Date.UTC(2017, 1, 15)), - end: new Date(Date.UTC(2017, 1, 16)), + start: startBooking1, + end: endBooking1, + displayStart: startBooking1, + displayEnd: endBooking1, }); + + const startBooking2 = new Date(Date.UTC(2017, 2, 15)); + const endBooking2 = new Date(Date.UTC(2017, 2, 16)); + const booking2 = createBooking('booking2', { - start: new Date(Date.UTC(2017, 2, 15)), - end: new Date(Date.UTC(2017, 2, 16)), + start: startBooking2, + end: endBooking2, + displayStart: startBooking2, + displayEnd: endBooking2, }); const ordersProps = { diff --git a/src/containers/InboxPage/__snapshots__/InboxPage.test.js.snap b/src/containers/InboxPage/__snapshots__/InboxPage.test.js.snap index 384682ce..5190eb80 100644 --- a/src/containers/InboxPage/__snapshots__/InboxPage.test.js.snap +++ b/src/containers/InboxPage/__snapshots__/InboxPage.test.js.snap @@ -163,6 +163,8 @@ exports[`InboxPage matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-02-16T00:00:00.000Z, + "displayStart": 2017-02-15T00:00:00.000Z, "end": 2017-02-16T00:00:00.000Z, "start": 2017-02-15T00:00:00.000Z, }, @@ -299,6 +301,8 @@ exports[`InboxPage matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-03-16T00:00:00.000Z, + "displayStart": 2017-03-15T00:00:00.000Z, "end": 2017-03-16T00:00:00.000Z, "start": 2017-03-15T00:00:00.000Z, }, @@ -581,6 +585,8 @@ exports[`InboxPage matches snapshot 3`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-02-16T00:00:00.000Z, + "displayStart": 2017-02-15T00:00:00.000Z, "end": 2017-02-16T00:00:00.000Z, "start": 2017-02-15T00:00:00.000Z, }, @@ -717,6 +723,8 @@ exports[`InboxPage matches snapshot 3`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-03-16T00:00:00.000Z, + "displayStart": 2017-03-15T00:00:00.000Z, "end": 2017-03-16T00:00:00.000Z, "start": 2017-03-15T00:00:00.000Z, }, diff --git a/src/containers/TransactionPage/TransactionPage.test.js b/src/containers/TransactionPage/TransactionPage.test.js index c8a7cd8e..7ac9bb79 100644 --- a/src/containers/TransactionPage/TransactionPage.test.js +++ b/src/containers/TransactionPage/TransactionPage.test.js @@ -16,12 +16,16 @@ const noop = () => null; describe('TransactionPage - Sale', () => { it('matches snapshot', () => { const txId = 'tx-sale-1'; + const start = new Date(Date.UTC(2017, 5, 10)); + const end = new Date(Date.UTC(2017, 5, 13)); const transaction = createTransaction({ id: txId, lastTransition: TRANSITION_REQUEST, booking: createBooking('booking1', { - start: new Date(Date.UTC(2017, 5, 10)), - end: new Date(Date.UTC(2017, 5, 13)), + start, + end, + displayStart: start, + displayEnd: end, }), listing: createListing('listing1'), customer: createUser('customer1'), @@ -68,12 +72,17 @@ describe('TransactionPage - Sale', () => { describe('TransactionPage - Order', () => { it('matches snapshot', () => { const txId = 'tx-order-1'; + const start = new Date(Date.UTC(2017, 5, 10)); + const end = new Date(Date.UTC(2017, 5, 13)); + const transaction = createTransaction({ id: txId, lastTransition: TRANSITION_REQUEST, booking: createBooking('booking1', { - start: new Date(Date.UTC(2017, 5, 10)), - end: new Date(Date.UTC(2017, 5, 13)), + start, + end, + displayStart: start, + displayEnd: end, }), listing: createListing('listing1'), customer: createUser('customer1'), diff --git a/src/containers/TransactionPage/__snapshots__/TransactionPage.test.js.snap b/src/containers/TransactionPage/__snapshots__/TransactionPage.test.js.snap index 3df15dcc..afb5685f 100644 --- a/src/containers/TransactionPage/__snapshots__/TransactionPage.test.js.snap +++ b/src/containers/TransactionPage/__snapshots__/TransactionPage.test.js.snap @@ -125,6 +125,8 @@ exports[`TransactionPage - Order matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, }, @@ -327,6 +329,8 @@ exports[`TransactionPage - Sale matches snapshot 1`] = ` }, "booking": Object { "attributes": Object { + "displayEnd": 2017-06-13T00:00:00.000Z, + "displayStart": 2017-06-10T00:00:00.000Z, "end": 2017-06-13T00:00:00.000Z, "start": 2017-06-10T00:00:00.000Z, },