mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 03:43:28 +10:00
Add test for rejected/autorejected tx transitions
This commit is contained in:
parent
0c7b8ca355
commit
ddb02dd059
4 changed files with 1570 additions and 10 deletions
|
|
@ -4,12 +4,16 @@ import { types } from '../../util/sdkLoader';
|
|||
import { createBooking, createListing, createUser, createTransaction } from '../../util/test-data';
|
||||
import { renderShallow } from '../../util/test-helpers';
|
||||
import { fakeIntl } from '../../util/test-data';
|
||||
import { TX_TRANSITION_PREAUTHORIZE } from '../../util/propTypes';
|
||||
import {
|
||||
TX_TRANSITION_PREAUTHORIZE,
|
||||
TX_TRANSITION_REJECT,
|
||||
TX_TRANSITION_AUTO_REJECT,
|
||||
} from '../../util/propTypes';
|
||||
import { BookingBreakdown } from '../../components';
|
||||
import { OrderDetailsPanelComponent } from './OrderDetailsPanel.js';
|
||||
|
||||
describe('OrderDetailsPanel', () => {
|
||||
it('matches snapshot', () => {
|
||||
it('preauthorized matches snapshot', () => {
|
||||
const { Money } = types;
|
||||
const tx = createTransaction({
|
||||
id: 'order-tx',
|
||||
|
|
@ -26,6 +30,40 @@ describe('OrderDetailsPanel', () => {
|
|||
const tree = renderShallow(<OrderDetailsPanelComponent transaction={tx} intl={fakeIntl} />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('rejected matches snapshot', () => {
|
||||
const { Money } = types;
|
||||
const tx = createTransaction({
|
||||
id: 'order-rejected',
|
||||
lastTransition: TX_TRANSITION_REJECT,
|
||||
total: new Money(16500, 'USD'),
|
||||
booking: createBooking('booking1', {
|
||||
start: new Date(Date.UTC(2017, 5, 10)),
|
||||
end: new Date(Date.UTC(2017, 5, 13)),
|
||||
}),
|
||||
listing: createListing('listing1'),
|
||||
provider: createUser('provider'),
|
||||
customer: createUser('customer'),
|
||||
});
|
||||
const tree = renderShallow(<OrderDetailsPanelComponent transaction={tx} intl={fakeIntl} />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('autorejected matches snapshot', () => {
|
||||
const { Money } = types;
|
||||
const tx = createTransaction({
|
||||
id: 'order-autorejected',
|
||||
lastTransition: TX_TRANSITION_AUTO_REJECT,
|
||||
total: new Money(16500, 'USD'),
|
||||
booking: createBooking('booking1', {
|
||||
start: new Date(Date.UTC(2017, 5, 10)),
|
||||
end: new Date(Date.UTC(2017, 5, 13)),
|
||||
}),
|
||||
listing: createListing('listing1'),
|
||||
provider: createUser('provider'),
|
||||
customer: createUser('customer'),
|
||||
});
|
||||
const tree = renderShallow(<OrderDetailsPanelComponent transaction={tx} intl={fakeIntl} />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('renders correct total price', () => {
|
||||
const { Money } = types;
|
||||
const tx = createTransaction({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,389 @@
|
|||
exports[`OrderDetailsPanel matches snapshot 1`] = `
|
||||
exports[`OrderDetailsPanel autorejected matches snapshot 1`] = `
|
||||
<div
|
||||
className="">
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100vw" />
|
||||
</div>
|
||||
<div
|
||||
className="">
|
||||
<AvatarMedium
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<div>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.orderAutoRejectedTitle"
|
||||
values={
|
||||
Object {
|
||||
"listingLink": <withFlattenedRoutes(withRouter(NamedLink))
|
||||
name="ListingPage"
|
||||
params={
|
||||
Object {
|
||||
"id": "listing1",
|
||||
"slug": "listing1-title",
|
||||
}
|
||||
}>
|
||||
listing1 title
|
||||
</withFlattenedRoutes(withRouter(NamedLink))>,
|
||||
}
|
||||
} />
|
||||
</h1>
|
||||
<div>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.orderAutoRejectedStatus"
|
||||
values={
|
||||
Object {
|
||||
"providerName": "provider display name",
|
||||
"transitionDate": <span>
|
||||
<FormattedDate
|
||||
day="numeric"
|
||||
month="short"
|
||||
value={2017-06-01T00:00:00.000Z}
|
||||
year="numeric" />
|
||||
</span>,
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/auto-reject",
|
||||
"lastTransitionedAt": 2017-06-01T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 16400,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer abbreviated name",
|
||||
"displayName": "customer display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "order-autorejected",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="customer" />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100%" />
|
||||
</div>
|
||||
<div>
|
||||
<AvatarMedium
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<div>
|
||||
<h2>
|
||||
listing1 title
|
||||
</h2>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.hostedBy"
|
||||
values={
|
||||
Object {
|
||||
"name": "provider display name",
|
||||
}
|
||||
} />
|
||||
</p>
|
||||
</div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/auto-reject",
|
||||
"lastTransitionedAt": 2017-06-01T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 16400,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer abbreviated name",
|
||||
"displayName": "customer display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "order-autorejected",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="customer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`OrderDetailsPanel preauthorized matches snapshot 1`] = `
|
||||
<div
|
||||
className="">
|
||||
<div>
|
||||
|
|
@ -171,13 +556,12 @@ exports[`OrderDetailsPanel matches snapshot 1`] = `
|
|||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"closed": false,
|
||||
"deleted": false,
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
|
|
@ -345,6 +729,392 @@ exports[`OrderDetailsPanel matches snapshot 1`] = `
|
|||
"id": UUID {
|
||||
"uuid": "order-tx",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="customer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`OrderDetailsPanel rejected matches snapshot 1`] = `
|
||||
<div
|
||||
className="">
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100vw" />
|
||||
</div>
|
||||
<div
|
||||
className="">
|
||||
<AvatarMedium
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<div>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.orderRejectedTitle"
|
||||
values={
|
||||
Object {
|
||||
"listingLink": <withFlattenedRoutes(withRouter(NamedLink))
|
||||
name="ListingPage"
|
||||
params={
|
||||
Object {
|
||||
"id": "listing1",
|
||||
"slug": "listing1-title",
|
||||
}
|
||||
}>
|
||||
listing1 title
|
||||
</withFlattenedRoutes(withRouter(NamedLink))>,
|
||||
}
|
||||
} />
|
||||
</h1>
|
||||
<div>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.orderRejectedStatus"
|
||||
values={
|
||||
Object {
|
||||
"providerName": "provider display name",
|
||||
"transitionDate": <span>
|
||||
<FormattedDate
|
||||
day="numeric"
|
||||
month="short"
|
||||
value={2017-06-01T00:00:00.000Z}
|
||||
year="numeric" />
|
||||
</span>,
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/reject",
|
||||
"lastTransitionedAt": 2017-06-01T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 16400,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer abbreviated name",
|
||||
"displayName": "customer display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "order-rejected",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"closed": false,
|
||||
"deleted": false,
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="customer" />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100%" />
|
||||
</div>
|
||||
<div>
|
||||
<AvatarMedium
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "provider abbreviated name",
|
||||
"displayName": "provider display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "provider",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<div>
|
||||
<h2>
|
||||
listing1 title
|
||||
</h2>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.hostedBy"
|
||||
values={
|
||||
Object {
|
||||
"name": "provider display name",
|
||||
}
|
||||
} />
|
||||
</p>
|
||||
</div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="OrderDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/reject",
|
||||
"lastTransitionedAt": 2017-06-01T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -100,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 16400,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer abbreviated name",
|
||||
"displayName": "customer display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "order-rejected",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
|
|
|
|||
|
|
@ -4,14 +4,18 @@ import { types } from '../../util/sdkLoader';
|
|||
import { createTransaction, createBooking, createListing, createUser } from '../../util/test-data';
|
||||
import { renderShallow } from '../../util/test-helpers';
|
||||
import { fakeIntl } from '../../util/test-data';
|
||||
import { TX_TRANSITION_PREAUTHORIZE } from '../../util/propTypes';
|
||||
import {
|
||||
TX_TRANSITION_PREAUTHORIZE,
|
||||
TX_TRANSITION_REJECT,
|
||||
TX_TRANSITION_AUTO_REJECT,
|
||||
} from '../../util/propTypes';
|
||||
import { BookingBreakdown } from '../../components';
|
||||
import { SaleDetailsPanelComponent } from './SaleDetailsPanel.js';
|
||||
|
||||
const noop = () => null;
|
||||
|
||||
describe('SaleDetailsPanel', () => {
|
||||
it('matches snapshot', () => {
|
||||
it('preauthorized matches snapshot', () => {
|
||||
const { Money } = types;
|
||||
const transaction = createTransaction({
|
||||
id: 'sale-tx',
|
||||
|
|
@ -37,6 +41,58 @@ describe('SaleDetailsPanel', () => {
|
|||
const tree = renderShallow(<SaleDetailsPanelComponent {...props} />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('rejected matches snapshot', () => {
|
||||
const { Money } = types;
|
||||
const transaction = createTransaction({
|
||||
id: 'sale-tx',
|
||||
lastTransition: TX_TRANSITION_REJECT,
|
||||
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)),
|
||||
}),
|
||||
listing: createListing('listing1'),
|
||||
customer: createUser('customer1'),
|
||||
lastTransitionedAt: new Date(Date.UTC(2017, 5, 10)),
|
||||
});
|
||||
const props = {
|
||||
transaction,
|
||||
onAcceptSale: noop,
|
||||
onRejectSale: noop,
|
||||
acceptInProgress: false,
|
||||
rejectInProgress: false,
|
||||
intl: fakeIntl,
|
||||
};
|
||||
const tree = renderShallow(<SaleDetailsPanelComponent {...props} />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('autorejected matches snapshot', () => {
|
||||
const { Money } = types;
|
||||
const transaction = createTransaction({
|
||||
id: 'sale-tx',
|
||||
lastTransition: TX_TRANSITION_AUTO_REJECT,
|
||||
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)),
|
||||
}),
|
||||
listing: createListing('listing1'),
|
||||
customer: createUser('customer1'),
|
||||
lastTransitionedAt: new Date(Date.UTC(2017, 5, 10)),
|
||||
});
|
||||
const props = {
|
||||
transaction,
|
||||
onAcceptSale: noop,
|
||||
onRejectSale: noop,
|
||||
acceptInProgress: false,
|
||||
rejectInProgress: false,
|
||||
intl: fakeIntl,
|
||||
};
|
||||
const tree = renderShallow(<SaleDetailsPanelComponent {...props} />);
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('renders correct total price', () => {
|
||||
const { Money } = types;
|
||||
const transaction = createTransaction({
|
||||
|
|
|
|||
|
|
@ -1,4 +1,352 @@
|
|||
exports[`SaleDetailsPanel matches snapshot 1`] = `
|
||||
exports[`SaleDetailsPanel autorejected matches snapshot 1`] = `
|
||||
<div
|
||||
className="">
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100vw" />
|
||||
</div>
|
||||
<div>
|
||||
<AvatarMedium
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<AvatarLarge
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.listingRejectedTitle"
|
||||
values={
|
||||
Object {
|
||||
"customerName": "customer1 display name",
|
||||
"listingLink": <withFlattenedRoutes(withRouter(NamedLink))
|
||||
name="ListingPage"
|
||||
params={
|
||||
Object {
|
||||
"id": "listing1",
|
||||
"slug": "listing1-title",
|
||||
}
|
||||
}>
|
||||
listing1 title
|
||||
</withFlattenedRoutes(withRouter(NamedLink))>,
|
||||
}
|
||||
} />
|
||||
</h1>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.saleAutoRejectedStatus"
|
||||
values={
|
||||
Object {
|
||||
"formattedDate": <span>
|
||||
<FormattedDate
|
||||
day="numeric"
|
||||
month="short"
|
||||
value={2017-06-10T00:00:00.000Z}
|
||||
weekday="long"
|
||||
year="numeric" />
|
||||
</span>,
|
||||
}
|
||||
} />
|
||||
</p>
|
||||
<div />
|
||||
</div>
|
||||
<div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/auto-reject",
|
||||
"lastTransitionedAt": 2017-06-10T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 15500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "sale-tx",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": null,
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="provider" />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100%" />
|
||||
</div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<div>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/auto-reject",
|
||||
"lastTransitionedAt": 2017-06-10T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 15500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "sale-tx",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": null,
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="provider" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`SaleDetailsPanel preauthorized matches snapshot 1`] = `
|
||||
<div
|
||||
className="">
|
||||
<div>
|
||||
|
|
@ -197,13 +545,12 @@ exports[`SaleDetailsPanel matches snapshot 1`] = `
|
|||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"closed": false,
|
||||
"deleted": false,
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
|
|
@ -328,6 +675,355 @@ exports[`SaleDetailsPanel matches snapshot 1`] = `
|
|||
"id": UUID {
|
||||
"uuid": "sale-tx",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"open": true,
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": null,
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="provider" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`SaleDetailsPanel rejected matches snapshot 1`] = `
|
||||
<div
|
||||
className="">
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100vw" />
|
||||
</div>
|
||||
<div>
|
||||
<AvatarMedium
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<AvatarLarge
|
||||
user={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
}
|
||||
} />
|
||||
</div>
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.listingRejectedTitle"
|
||||
values={
|
||||
Object {
|
||||
"customerName": "customer1 display name",
|
||||
"listingLink": <withFlattenedRoutes(withRouter(NamedLink))
|
||||
name="ListingPage"
|
||||
params={
|
||||
Object {
|
||||
"id": "listing1",
|
||||
"slug": "listing1-title",
|
||||
}
|
||||
}>
|
||||
listing1 title
|
||||
</withFlattenedRoutes(withRouter(NamedLink))>,
|
||||
}
|
||||
} />
|
||||
</h1>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.saleRejectedStatus"
|
||||
values={
|
||||
Object {
|
||||
"formattedDate": <span>
|
||||
<FormattedDate
|
||||
day="numeric"
|
||||
month="short"
|
||||
value={2017-06-10T00:00:00.000Z}
|
||||
weekday="long"
|
||||
year="numeric" />
|
||||
</span>,
|
||||
}
|
||||
} />
|
||||
</p>
|
||||
<div />
|
||||
</div>
|
||||
<div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/reject",
|
||||
"lastTransitionedAt": 2017-06-10T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 15500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "sale-tx",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
"closed": false,
|
||||
"deleted": false,
|
||||
"description": "listing1 description",
|
||||
"geolocation": LatLng {
|
||||
"lat": 40,
|
||||
"lng": 60,
|
||||
},
|
||||
"price": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"title": "listing1 title",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "listing1",
|
||||
},
|
||||
"type": "listing",
|
||||
},
|
||||
"provider": null,
|
||||
"type": "transaction",
|
||||
}
|
||||
}
|
||||
userRole="provider" />
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<ResponsiveImage
|
||||
alt="listing1 title"
|
||||
className={null}
|
||||
image={null}
|
||||
nameSet={
|
||||
Array [
|
||||
Object {
|
||||
"name": "landscape-crop",
|
||||
"size": "400w",
|
||||
},
|
||||
Object {
|
||||
"name": "landscape-crop2x",
|
||||
"size": "800w",
|
||||
},
|
||||
]
|
||||
}
|
||||
noImageMessage={null}
|
||||
rootClassName={null}
|
||||
sizes="100%" />
|
||||
</div>
|
||||
<h3>
|
||||
<FormattedMessage
|
||||
id="SaleDetailsPanel.bookingBreakdownTitle"
|
||||
values={Object {}} />
|
||||
</h3>
|
||||
<div>
|
||||
<BookingBreakdown
|
||||
booking={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
}
|
||||
}
|
||||
transaction={
|
||||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/reject",
|
||||
"lastTransitionedAt": 2017-06-10T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
"code": "line-item/night",
|
||||
"lineTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"quantity": "3",
|
||||
"unitPrice": Money {
|
||||
"amount": 5500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"code": "line-item/provider-commission",
|
||||
"lineTotal": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
"unitPrice": Money {
|
||||
"amount": -1000,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
],
|
||||
"payinTotal": Money {
|
||||
"amount": 16500,
|
||||
"currency": "USD",
|
||||
},
|
||||
"payoutTotal": Money {
|
||||
"amount": 15500,
|
||||
"currency": "USD",
|
||||
},
|
||||
},
|
||||
"booking": Object {
|
||||
"attributes": Object {
|
||||
"end": 2017-06-13T00:00:00.000Z,
|
||||
"start": 2017-06-10T00:00:00.000Z,
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "booking1",
|
||||
},
|
||||
"type": "booking",
|
||||
},
|
||||
"customer": Object {
|
||||
"attributes": Object {
|
||||
"banned": false,
|
||||
"profile": Object {
|
||||
"abbreviatedName": "customer1 abbreviated name",
|
||||
"displayName": "customer1 display name",
|
||||
},
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "customer1",
|
||||
},
|
||||
"type": "user",
|
||||
},
|
||||
"id": UUID {
|
||||
"uuid": "sale-tx",
|
||||
},
|
||||
"listing": Object {
|
||||
"attributes": Object {
|
||||
"address": "listing1 address",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue