Merge pull request #5716 from overleaf/ab-tear-down-de-ng-plans-page-test

Tear down de-ng split test and cleanup old version

GitOrigin-RevId: 02438bbb2e530dfe72f046dd91c547d97c39c96e
This commit is contained in:
Alexandre Bourdin
2021-11-09 09:04:51 +00:00
committed by Copybot
parent 6122520bf5
commit c881909258
7 changed files with 4 additions and 378 deletions
@@ -185,40 +185,10 @@ describe('SubscriptionController', function () {
})
})
describe('splitTest', function () {
const cases = [
{
variant: 'default',
template: 'subscriptions/plans',
},
{
variant: 'de-ng',
template: 'subscriptions/plans-marketing',
},
]
for (const { variant, template } of cases) {
describe(variant, function () {
beforeEach(function () {
const assignment = { variant }
this.SplitTestV2Hander.promises.getAssignmentForSession.resolves(
assignment
)
})
it(`should render template ${template}`, function (done) {
this.res.render = page => {
page.should.equal(template)
done()
}
this.SubscriptionController.plansPage(this.req, this.res)
})
})
}
})
describe('groupPlanModal data', function () {
it('should pass local currency if valid', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/plans')
page.should.equal('subscriptions/plans-marketing')
opts.groupPlanModalDefaults.currency.should.equal('GBP')
done()
}
@@ -230,7 +200,7 @@ describe('SubscriptionController', function () {
it('should fallback to USD when valid', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/plans')
page.should.equal('subscriptions/plans-marketing')
opts.groupPlanModalDefaults.currency.should.equal('USD')
done()
}
@@ -242,7 +212,7 @@ describe('SubscriptionController', function () {
it('should pass valid options for group plan modal and discard invalid', function (done) {
this.res.render = (page, opts) => {
page.should.equal('subscriptions/plans')
page.should.equal('subscriptions/plans-marketing')
opts.groupPlanModalDefaults.size.should.equal('42')
opts.groupPlanModalDefaults.plan_code.should.equal('collaborator')
opts.groupPlanModalDefaults.currency.should.equal('GBP')