diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.js b/services/web/app/src/Features/Subscription/SubscriptionController.js index d9674e5265..46f3a8613c 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionController.js @@ -397,6 +397,7 @@ async function interstitialPaymentPage(req, res) { latamCountryBannerDetails, skipLinkTarget: req.session?.postCheckoutRedirect || '/project', websiteRedesignPlansVariant: websiteRedesignPlansAssignment.variant, + countryCode, }) } } diff --git a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js index c416a14cb7..10ade4d33b 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js @@ -525,6 +525,16 @@ describe('SubscriptionController', function () { }) }) }) + it('should return correct countryCode', function (done) { + this.GeoIpLookup.promises.getCurrencyCode.resolves({ + countryCode: 'MX', + }) + this.res.render = (page, opts) => { + expect(opts.countryCode).to.equal('MX') + done() + } + this.SubscriptionController.plansPage(this.req, this.res) + }) }) describe('plansPage light touch redesign', function () { @@ -772,6 +782,17 @@ describe('SubscriptionController', function () { this.SubscriptionController.plansPageLightDesign(this.req, this.res) }) }) + + it('should return correct countryCode', function (done) { + this.GeoIpLookup.promises.getCurrencyCode.resolves({ + countryCode: 'MX', + }) + this.res.render = (page, opts) => { + expect(opts.countryCode).to.equal('MX') + done() + } + this.SubscriptionController.plansPageLightDesign(this.req, this.res) + }) }) describe('interstitialPaymentPage', function () { @@ -959,6 +980,17 @@ describe('SubscriptionController', function () { }) }) }) + + it('should return correct countryCode', function (done) { + this.GeoIpLookup.promises.getCurrencyCode.resolves({ + countryCode: 'MX', + }) + this.res.render = (page, opts) => { + expect(opts.countryCode).to.equal('MX') + done() + } + this.SubscriptionController.interstitialPaymentPage(this.req, this.res) + }) }) describe('successfulSubscription', function () {