Use UTC dates in tests and examples

This commit is contained in:
Kimmo Puputti 2017-04-13 13:21:22 +03:00
parent bca56b361e
commit a2c38b903f
5 changed files with 13 additions and 13 deletions

View file

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

View file

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

View file

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

View file

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

View file

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