From d5cf331113aff61a240c59a2883b7ecd5f8dc02f Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 19 Jun 2019 17:22:57 +0300 Subject: [PATCH] Update BookingBreakdown component: use SCA process --- .../BookingBreakdown/BookingBreakdown.example.js | 15 +++++++++++---- .../BookingBreakdown/BookingBreakdown.test.js | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/BookingBreakdown/BookingBreakdown.example.js b/src/components/BookingBreakdown/BookingBreakdown.example.js index 5c8855c3..271536f5 100644 --- a/src/components/BookingBreakdown/BookingBreakdown.example.js +++ b/src/components/BookingBreakdown/BookingBreakdown.example.js @@ -6,7 +6,8 @@ import { TRANSITION_COMPLETE, TRANSITION_DECLINE, TRANSITION_EXPIRE, - TRANSITION_REQUEST, + TRANSITION_REQUEST_PAYMENT, + TRANSITION_CONFIRM_PAYMENT, TX_TRANSITION_ACTOR_CUSTOMER, } from '../../util/transaction'; import { LINE_ITEM_DAY, LINE_ITEM_NIGHT, LINE_ITEM_UNITS } from '../../util/types'; @@ -27,18 +28,24 @@ const exampleBooking = attributes => { const exampleTransaction = params => { const created = new Date(Date.UTC(2017, 1, 1)); + const confirmed = new Date(Date.UTC(2017, 1, 1, 0, 1)); return { id: new UUID('example-transaction'), type: 'transaction', attributes: { createdAt: created, lastTransitionedAt: created, - lastTransition: TRANSITION_REQUEST, + lastTransition: TRANSITION_CONFIRM_PAYMENT, transitions: [ { createdAt: created, by: TX_TRANSITION_ACTOR_CUSTOMER, - transition: TRANSITION_REQUEST, + transition: TRANSITION_REQUEST_PAYMENT, + }, + { + createdAt: confirmed, + by: TX_TRANSITION_ACTOR_CUSTOMER, + transition: TRANSITION_CONFIRM_PAYMENT, }, ], @@ -205,7 +212,7 @@ export const ProviderSalePreauthorized = { userRole: 'provider', unitType: LINE_ITEM_NIGHT, transaction: exampleTransaction({ - lastTransition: TRANSITION_REQUEST, + lastTransition: TRANSITION_CONFIRM_PAYMENT, payinTotal: new Money(4500, CURRENCY), payoutTotal: new Money(2500, CURRENCY), lineItems: [ diff --git a/src/components/BookingBreakdown/BookingBreakdown.test.js b/src/components/BookingBreakdown/BookingBreakdown.test.js index 90a95372..8d797c2c 100644 --- a/src/components/BookingBreakdown/BookingBreakdown.test.js +++ b/src/components/BookingBreakdown/BookingBreakdown.test.js @@ -5,7 +5,7 @@ import { renderDeep } from '../../util/test-helpers'; import { types as sdkTypes } from '../../util/sdkLoader'; import { TRANSITION_CANCEL, - TRANSITION_REQUEST, + TRANSITION_REQUEST_PAYMENT, TX_TRANSITION_ACTOR_CUSTOMER, } from '../../util/transaction'; import { LINE_ITEM_NIGHT } from '../../util/types'; @@ -21,12 +21,12 @@ const exampleTransaction = params => { attributes: { createdAt: created, lastTransitionedAt: created, - lastTransition: TRANSITION_REQUEST, + lastTransition: TRANSITION_REQUEST_PAYMENT, transitions: [ { createdAt: created, by: TX_TRANSITION_ACTOR_CUSTOMER, - transition: TRANSITION_REQUEST, + transition: TRANSITION_REQUEST_PAYMENT, }, ],