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