From 9ffcb9eaeecd33bff9afacf2afe9d29a94a47646 Mon Sep 17 00:00:00 2001 From: M Fahru Date: Tue, 14 Jan 2025 08:43:35 -0700 Subject: [PATCH] Merge pull request #22493 from overleaf/mf-remove-website-redesign-plans-test-config [web] Remove `website-redesign-plans` test config from acceptance test and redirection tests from unit tests GitOrigin-RevId: f1b30231be06748726ec2921fe23deadf2a701b6 --- .../SubscriptionControllerTests.js | 89 ------------------- 1 file changed, 89 deletions(-) diff --git a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js index 806113920d..67a7233ae9 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js @@ -390,95 +390,6 @@ describe('SubscriptionController', function () { }) }) - describe('website-redesign-plans test', function () { - beforeEach(function () { - this.req.query = {} - }) - describe('"default" variant', function () { - // note: if test is not active, default variant is assigned - beforeEach(function () { - this.SplitTestV2Hander.promises.getAssignment - .withArgs(this.req, this.res, 'website-redesign-plans') - .resolves({ - variant: 'default', - }) - }) - - it('renders "default" variant', function (done) { - this.res.render = page => { - page.should.equal('subscriptions/plans') - expect(this.res.redirect).to.not.have.been.called - done() - } - this.SubscriptionController.plansPage(this.req, this.res) - }) - }) - - describe('"new-design" variant', function () { - beforeEach(function () { - this.SplitTestV2Hander.promises.getAssignment - .withArgs(this.req, this.res, 'website-redesign-plans') - .resolves({ - variant: 'new-design', - }) - }) - - it('redirects to "new-design" variant', function (done) { - this.res.callback = () => { - expect(this.res.redirect).to.have.been.calledWith( - 302, - '/user/subscription/plans-2' - ) - done() - } - this.SubscriptionController.plansPage(this.req, this.res) - }) - - it('passes query params when redirecting to new design variant', function (done) { - this.req.query = { currency: 'USD' } - this.res.callback = () => { - expect(this.res.redirect).to.have.been.calledWith( - 302, - '/user/subscription/plans-2?currency=USD' - ) - done() - } - this.SubscriptionController.plansPage(this.req, this.res) - }) - }) - describe('"light-design" variant', function () { - beforeEach(function () { - this.SplitTestV2Hander.promises.getAssignment - .withArgs(this.req, this.res, 'website-redesign-plans') - .resolves({ - variant: 'light-design', - }) - }) - - it('renders "light-design" variant', function (done) { - this.res.callback = () => { - expect(this.res.redirect).to.have.been.calledWith( - 302, - '/user/subscription/plans-3' - ) - done() - } - this.SubscriptionController.plansPage(this.req, this.res) - }) - - it('passes query params when redirecting to new design variant', function (done) { - this.req.query = { currency: 'USD' } - this.res.callback = () => { - expect(this.res.redirect).to.have.been.calledWith( - 302, - '/user/subscription/plans-3?currency=USD' - ) - done() - } - this.SubscriptionController.plansPage(this.req, this.res) - }) - }) - }) it('should return correct countryCode', function (done) { this.GeoIpLookup.promises.getCurrencyCode.resolves({ countryCode: 'MX',