Merge pull request #23117 from overleaf/ii-flexible-group-licensing-subscription-page
[web] Subscription page for flexible licensing GitOrigin-RevId: 8f2fab1fc01e27063d716a86add66b1b9a72cbe6
This commit is contained in:
@@ -56,6 +56,7 @@ describe('SubscriptionGroupController', function () {
|
||||
.stub()
|
||||
.resolves(this.createSubscriptionChangeData),
|
||||
ensureFlexibleLicensingEnabled: sinon.stub().resolves(),
|
||||
ensureSubscriptionIsActive: sinon.stub().resolves(),
|
||||
getGroupPlanUpgradePreview: sinon
|
||||
.stub()
|
||||
.resolves(this.previewSubscriptionChangeData),
|
||||
@@ -347,6 +348,9 @@ describe('SubscriptionGroupController', function () {
|
||||
this.SubscriptionGroupHandler.promises.ensureFlexibleLicensingEnabled
|
||||
.calledWith(this.plan)
|
||||
.should.equal(true)
|
||||
this.SubscriptionGroupHandler.promises.ensureSubscriptionIsActive
|
||||
.calledWith(this.subscription)
|
||||
.should.equal(true)
|
||||
page.should.equal('subscriptions/add-seats')
|
||||
props.subscriptionId.should.equal(this.subscriptionId)
|
||||
props.groupName.should.equal(this.subscription.teamName)
|
||||
@@ -403,6 +407,21 @@ describe('SubscriptionGroupController', function () {
|
||||
|
||||
this.Controller.addSeatsToGroupSubscription(this.req, res)
|
||||
})
|
||||
|
||||
it('should redirect to subscription page when subscription is not active', function (done) {
|
||||
this.SubscriptionGroupHandler.promises.ensureSubscriptionIsActive = sinon
|
||||
.stub()
|
||||
.rejects()
|
||||
|
||||
const res = {
|
||||
redirect: url => {
|
||||
url.should.equal('/user/subscription')
|
||||
done()
|
||||
},
|
||||
}
|
||||
|
||||
this.Controller.addSeatsToGroupSubscription(this.req, res)
|
||||
})
|
||||
})
|
||||
|
||||
describe('previewAddSeatsSubscriptionChange', function () {
|
||||
|
||||
Reference in New Issue
Block a user