Skip to content

Commit

Permalink
Fix problem
Browse files Browse the repository at this point in the history
  • Loading branch information
brizental committed Jan 25, 2023
1 parent 1f58a2c commit 003e9d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/functional/testAddons.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ describe('Addons', function() {
// exitCountryCode);
// });

describe('test message_subscription_expiring addon condition', async () => {
describe('test message_subscription_expiring addon condition', () => {
// 1 to 7 days out from expiring.
//
// In these cases the message is shown.
Expand Down Expand Up @@ -167,14 +167,14 @@ describe('Addons', function() {
const mockDetails = { ...SubscriptionDetails };
// We are faking a Stripe subscription, so this value is expected to be in seconds.
mockDetails.subscription.current_period_end = Math.floor(expiresOn / 1000);
ctx.guardianSubscriptionDetailsCallback = () => {
ctx.guardianOverrideEndpoints.GETs['/api/v1/vpn/subscriptionDetails'].status = 200;
ctx.guardianOverrideEndpoints
this.ctx.guardianSubscriptionDetailsCallback = () => {
this.ctx.guardianOverrideEndpoints.GETs['/api/v1/vpn/subscriptionDetails'].status = 200;
this.ctx.guardianOverrideEndpoints
.GETs['/api/v1/vpn/subscriptionDetails']
.body = mockDetails;
};

it(`is message shown when expiration happens ${Date.now() - expiresOn} from now`, async () => {
it(`is message shown when expiration happens ${Date.now() - expiresOn}ms from now`, async () => {
// Load all production addons.
// These are loaded all together, so we don't know the exact number of addons.
await vpn.resetAddons('prod');
Expand All @@ -187,7 +187,7 @@ describe('Addons', function() {
const isSubscriptionExpiringMessageAvailable = loadedMessages.includes("message_subscription_expiring");
return isMessageShown ? isSubscriptionExpiringMessageAvailable : !isSubscriptionExpiringMessageAvailable;
});
})
});
});
});
});

0 comments on commit 003e9d6

Please sign in to comment.