mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Use UTC dates in tests and examples
This commit is contained in:
parent
bca56b361e
commit
a2c38b903f
5 changed files with 13 additions and 13 deletions
|
|
@ -5,7 +5,7 @@ export const Empty = {
|
|||
component: BookingInfo,
|
||||
props: {
|
||||
unitPrice: new types.Money(10, 'USD'),
|
||||
bookingStart: new Date('Fri, 14 Apr 2017 GMT'),
|
||||
bookingEnd: new Date('Sun, 16 Apr 2017 GMT'),
|
||||
bookingStart: new Date(Date.UTC(2017, 3, 14)),
|
||||
bookingEnd: new Date(Date.UTC(2017, 3, 16)),
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ describe('BookingInfo', () => {
|
|||
const tree = renderDeep(
|
||||
<BookingInfo
|
||||
unitPrice={new types.Money(1000, 'USD')}
|
||||
bookingStart={new Date('Fri, 14 Apr 2017 GMT')}
|
||||
bookingEnd={new Date('Sun, 16 Apr 2017 GMT')}
|
||||
bookingStart={new Date(Date.UTC(2017, 3, 14))}
|
||||
bookingEnd={new Date(Date.UTC(2017, 3, 16))}
|
||||
intl={fakeIntl}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ exports[`BookingInfo matches snapshot 1`] = `
|
|||
</span>
|
||||
<br />
|
||||
<span>
|
||||
04/14/2017 - 04/16/2017
|
||||
4/14/2017 - 4/16/2017
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ describe('CheckoutPage', () => {
|
|||
it('matches snapshot', () => {
|
||||
const props = {
|
||||
bookingDates: {
|
||||
bookingStart: new Date('Fri, 14 Apr 2017 GMT'),
|
||||
bookingEnd: new Date('Sun, 16 Apr 2017 GMT'),
|
||||
bookingStart: new Date(Date.UTC(2017, 3, 14)),
|
||||
bookingEnd: new Date(Date.UTC(2017, 3, 16)),
|
||||
},
|
||||
flattenedRoutes: [],
|
||||
history: { push: noop },
|
||||
|
|
@ -29,8 +29,8 @@ describe('CheckoutPage', () => {
|
|||
const author = createUser('author1');
|
||||
const listing = { ...createListing('00000000-0000-0000-0000-000000000000'), author };
|
||||
const bookingDates = {
|
||||
bookingStart: new Date('Fri, 14 Apr 2017 GMT'),
|
||||
bookingEnd: new Date('Sun, 16 Apr 2017 GMT'),
|
||||
bookingStart: new Date(Date.UTC(2017, 3, 14)),
|
||||
bookingEnd: new Date(Date.UTC(2017, 3, 16)),
|
||||
};
|
||||
const expectedAction = {
|
||||
type: SET_INITAL_VALUES,
|
||||
|
|
@ -54,8 +54,8 @@ describe('CheckoutPage', () => {
|
|||
const author = createUser('author1');
|
||||
const listing = { ...createListing('00000000-0000-0000-0000-000000000000'), author };
|
||||
const bookingDates = {
|
||||
bookingStart: new Date('Fri, 14 Apr 2017 GMT'),
|
||||
bookingEnd: new Date('Sun, 16 Apr 2017 GMT'),
|
||||
bookingStart: new Date(Date.UTC(2017, 3, 14)),
|
||||
bookingEnd: new Date(Date.UTC(2017, 3, 16)),
|
||||
};
|
||||
const payload = { listing, bookingDates };
|
||||
expect(checkoutPageReducer({}, { type: SET_INITAL_VALUES, payload })).toEqual(payload);
|
||||
|
|
|
|||
|
|
@ -53,14 +53,14 @@ export const createTransaction = options => {
|
|||
state = 'state/preauthorized',
|
||||
customer = null,
|
||||
provider = null,
|
||||
lastTransitionedAt = new Date(2017, 5, 1),
|
||||
lastTransitionedAt = new Date(Date.UTC(2017, 5, 1)),
|
||||
} = options;
|
||||
return {
|
||||
id: new UUID(id),
|
||||
type: 'transaction',
|
||||
attributes: {
|
||||
commission: null,
|
||||
createdAt: new Date(2017, 4, 1),
|
||||
createdAt: new Date(Date.UTC(2017, 4, 1)),
|
||||
lastTransitionedAt,
|
||||
state,
|
||||
total: null,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue