Skip to content

Commit bba9f55

Browse files
committed
Fix test date that has now arrived & will break test code next month
Yes, we could do this better, or we could just update these dates once every 5 years and that's probably not so bad now is it.
1 parent bb6e888 commit bba9f55

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

api/test/paddle-webhook.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('Paddle webhooks', () => {
8383
.forPatch('/api/v2/users/' + userId)
8484
.thenJson(200, {});
8585

86-
const nextRenewal = moment('2025-01-01');
86+
const nextRenewal = moment('2030-01-01');
8787

8888
await triggerWebhook(apiServer, {
8989
alert_name: 'subscription_created',
@@ -128,7 +128,7 @@ describe('Paddle webhooks', () => {
128128
.forPatch('/api/v2/users/' + userId)
129129
.thenJson(200, {});
130130

131-
const nextRenewal = moment('2025-01-01');
131+
const nextRenewal = moment('2030-01-01');
132132

133133
await triggerWebhook(apiServer, {
134134
alert_name: 'subscription_created',
@@ -196,7 +196,7 @@ describe('Paddle webhooks', () => {
196196
.forPatch('/api/v2/users/' + memberId)
197197
.thenJson(200, {});
198198

199-
const nextRenewal = moment('2025-01-01');
199+
const nextRenewal = moment('2030-01-01');
200200

201201
await triggerWebhook(apiServer, {
202202
alert_name: 'subscription_created',
@@ -265,7 +265,7 @@ describe('Paddle webhooks', () => {
265265
.forPatch('/api/v2/users/' + memberId)
266266
.thenJson(200, {});
267267

268-
const nextRenewal = moment('2025-01-01');
268+
const nextRenewal = moment('2030-01-01');
269269

270270
await triggerWebhook(apiServer, {
271271
alert_name: 'subscription_created',
@@ -290,7 +290,7 @@ describe('Paddle webhooks', () => {
290290
it('should successfully renew subscriptions', async () => {
291291
const userId = "abc";
292292
const userEmail = '[email protected]';
293-
const nextRenewal = moment('2025-01-01');
293+
const nextRenewal = moment('2030-01-01');
294294

295295
givenUser(userId, userEmail, {
296296
subscription_status: 'active',
@@ -336,7 +336,7 @@ describe('Paddle webhooks', () => {
336336
it('successfully cancel subscriptions on request', async () => {
337337
const userId = "abc";
338338
const userEmail = '[email protected]';
339-
const cancellationDate = moment('2025-01-01');
339+
const cancellationDate = moment('2030-01-01');
340340

341341
givenUser(userId, userEmail, {
342342
subscription_status: 'active',
@@ -502,7 +502,7 @@ describe('Paddle webhooks', () => {
502502
.forPatch('/api/v2/users/' + userId)
503503
.thenJson(200, {});
504504

505-
const nextRenewal = moment('2025-01-01');
505+
const nextRenewal = moment('2030-01-01');
506506

507507
await triggerWebhook(apiServer, {
508508
alert_name: 'subscription_created',
@@ -549,7 +549,7 @@ describe('Paddle webhooks', () => {
549549
.forPatch('/api/v2/users/' + userId)
550550
.thenJson(200, {});
551551

552-
const nextRenewal = moment('2025-01-01');
552+
const nextRenewal = moment('2030-01-01');
553553

554554
await triggerWebhook(apiServer, {
555555
alert_name: 'subscription_created',
@@ -600,7 +600,7 @@ describe('Paddle webhooks', () => {
600600
.forPatch('/api/v2/users/' + userId)
601601
.thenJson(200, {});
602602

603-
const nextRenewal = moment('2025-01-01');
603+
const nextRenewal = moment('2030-01-01');
604604

605605
await triggerWebhook(apiServer, {
606606
alert_name: 'subscription_payment_succeeded',
@@ -646,7 +646,7 @@ describe('Paddle webhooks', () => {
646646
.forPatch('/api/v2/users/' + userId)
647647
.thenJson(200, {});
648648

649-
const nextRenewal = moment('2025-01-01');
649+
const nextRenewal = moment('2030-01-01');
650650

651651
await triggerWebhook(apiServer, {
652652
alert_name: 'subscription_payment_succeeded',

api/test/paypro-webhook.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('PayPro webhooks', () => {
106106
CUSTOMER_ID: '123',
107107
SUBSCRIPTION_ID: '456',
108108
SUBSCRIPTION_RENEWAL_TYPE: 'Auto',
109-
SUBSCRIPTION_NEXT_CHARGE_DATE: formatRenewalDate(moment('2025-01-01')),
109+
SUBSCRIPTION_NEXT_CHARGE_DATE: formatRenewalDate(moment('2030-01-01')),
110110
INVOICE_LINK: "https://store.payproglobal.com/Invoice?Id=MY_UUID",
111111
PRODUCT_QUANTITY: '1',
112112
TEST_MODE: '0',
@@ -141,7 +141,7 @@ describe('PayPro webhooks', () => {
141141
.forPatch('/api/v2/users/' + userId)
142142
.thenJson(200, {});
143143

144-
const nextRenewal = moment('2025-01-01');
144+
const nextRenewal = moment('2030-01-01');
145145

146146
await triggerWebhook(apiServer, {
147147
IPN_TYPE_NAME: 'OrderCharged',
@@ -191,7 +191,7 @@ describe('PayPro webhooks', () => {
191191
.forPatch('/api/v2/users/' + userId)
192192
.thenJson(200, {});
193193

194-
const nextRenewal = moment('2025-01-01');
194+
const nextRenewal = moment('2030-01-01');
195195

196196
await triggerWebhook(apiServer, {
197197
IPN_TYPE_NAME: 'OrderCharged',
@@ -226,7 +226,7 @@ describe('PayPro webhooks', () => {
226226
it('should successfully renew subscriptions', async () => {
227227
const userId = "abc";
228228
const userEmail = '[email protected]';
229-
const nextRenewal = moment('2025-01-01');
229+
const nextRenewal = moment('2030-01-01');
230230

231231
givenUser(userId, userEmail, {
232232
subscription_status: 'active',
@@ -267,7 +267,7 @@ describe('PayPro webhooks', () => {
267267
it('should cancel terminated subscriptions', async () => {
268268
const userId = "abc";
269269
const userEmail = '[email protected]';
270-
const nextRenewal = moment('2025-01-01');
270+
const nextRenewal = moment('2030-01-01');
271271

272272
givenUser(userId, userEmail, {
273273
subscription_status: 'active',
@@ -308,7 +308,7 @@ describe('PayPro webhooks', () => {
308308
it('should cancel suspended subscriptions', async () => {
309309
const userId = "abc";
310310
const userEmail = '[email protected]';
311-
const nextRenewal = moment('2025-01-01');
311+
const nextRenewal = moment('2030-01-01');
312312

313313
givenUser(userId, userEmail, {
314314
subscription_status: 'active',
@@ -349,7 +349,7 @@ describe('PayPro webhooks', () => {
349349
it('should handle users whose renewal payments fail', async () => {
350350
const userId = "abc";
351351
const userEmail = '[email protected]';
352-
const nextRenewal = moment('2025-01-01');
352+
const nextRenewal = moment('2030-01-01');
353353

354354
givenUser(userId, userEmail, {
355355
subscription_status: 'active',
@@ -411,7 +411,7 @@ describe('PayPro webhooks', () => {
411411
.thenReply(200);
412412

413413
const subscriptionCreation = moment.utc('2020-01-01');
414-
const nextRenewal = moment.utc('2025-01-01');
414+
const nextRenewal = moment.utc('2030-01-01');
415415

416416
await triggerWebhook(apiServer, {
417417
IPN_TYPE_NAME: 'OrderCharged',

0 commit comments

Comments
 (0)