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
This commit is contained in:
M Fahru
2025-01-14 08:43:35 -07:00
committed by Copybot
parent c160b85079
commit 9ffcb9eaee

View File

@@ -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',