Просмотр исходного кода

test(core): Fix Promotion e2e tests

Bad date handling coverted to UTC
Michael Bromley 6 лет назад
Родитель
Сommit
993d2ea604

+ 4 - 4
packages/core/e2e/__snapshots__/promotion.e2e-spec.ts.snap

@@ -71,9 +71,9 @@ Object {
   ],
   "couponCode": "TEST123",
   "enabled": true,
-  "endsAt": "2019-11-30T23:00:00.000Z",
+  "endsAt": "2019-12-01T00:00:00.000Z",
   "name": "test promotion",
-  "startsAt": "2019-10-29T23:00:00.000Z",
+  "startsAt": "2019-10-30T00:00:00.000Z",
 }
 `;
 
@@ -115,8 +115,8 @@ Object {
   ],
   "couponCode": "TEST1235",
   "enabled": true,
-  "endsAt": "2019-05-31T22:00:00.000Z",
+  "endsAt": "2019-06-01T22:00:00.000Z",
   "name": "test promotion",
-  "startsAt": "2019-05-29T22:00:00.000Z",
+  "startsAt": "2019-05-30T22:00:00.000Z",
 }
 `;

+ 4 - 4
packages/core/e2e/promotion.e2e-spec.ts

@@ -73,8 +73,8 @@ describe('Promotion resolver', () => {
                     name: 'test promotion',
                     enabled: true,
                     couponCode: 'TEST123',
-                    startsAt: new Date(2019, 9, 30),
-                    endsAt: new Date(2019, 11, 1),
+                    startsAt: new Date('2019-10-30T00:00:00.000Z'),
+                    endsAt: new Date('2019-12-01T00:00:00.000Z'),
                     conditions: [
                         {
                             code: promoCondition.code,
@@ -132,8 +132,8 @@ describe('Promotion resolver', () => {
                 input: {
                     id: promotion.id,
                     couponCode: 'TEST1235',
-                    startsAt: new Date(2019, 4, 30),
-                    endsAt: new Date(2019, 5, 1),
+                    startsAt: new Date('2019-05-30T22:00:00.000Z'),
+                    endsAt: new Date('2019-06-01T22:00:00.000Z'),
                     conditions: [
                         {
                             code: promoCondition.code,