Update tests in TransactionPanel.

This commit is contained in:
Vesa Luusua 2019-01-28 18:44:30 +02:00
parent caad06353e
commit 726389c941
2 changed files with 65 additions and 0 deletions

View file

@ -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,
});

View file

@ -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 {