mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #23366 from overleaf/ii-flexible-licensing-add-seats-for-all-legacy-plans
[web] Add seats feature for smaller groups GitOrigin-RevId: 7b0d1ea61eaaf603610d5fd8df399c00d328be70
This commit is contained in:
@@ -56,7 +56,6 @@ describe('SubscriptionGroupController', function () {
|
||||
.stub()
|
||||
.resolves(this.createSubscriptionChangeData),
|
||||
ensureFlexibleLicensingEnabled: sinon.stub().resolves(),
|
||||
ensureAddSeatsEnabled: sinon.stub().resolves(),
|
||||
getGroupPlanUpgradePreview: sinon
|
||||
.stub()
|
||||
.resolves(this.previewSubscriptionChangeData),
|
||||
@@ -337,9 +336,6 @@ describe('SubscriptionGroupController', function () {
|
||||
this.SubscriptionGroupHandler.promises.ensureFlexibleLicensingEnabled
|
||||
.calledWith(this.plan)
|
||||
.should.equal(true)
|
||||
this.SubscriptionGroupHandler.promises.ensureAddSeatsEnabled
|
||||
.calledWith(this.plan)
|
||||
.should.equal(true)
|
||||
page.should.equal('subscriptions/add-seats')
|
||||
props.subscriptionId.should.equal(this.subscriptionId)
|
||||
props.groupName.should.equal(this.subscription.teamName)
|
||||
@@ -379,21 +375,6 @@ describe('SubscriptionGroupController', function () {
|
||||
|
||||
this.Controller.addSeatsToGroupSubscription(this.req, res)
|
||||
})
|
||||
|
||||
it('should redirect to subscription page when "add seats" is not enabled', function (done) {
|
||||
this.SubscriptionGroupHandler.promises.ensureAddSeatsEnabled = sinon
|
||||
.stub()
|
||||
.rejects()
|
||||
|
||||
const res = {
|
||||
redirect: url => {
|
||||
url.should.equal('/user/subscription')
|
||||
done()
|
||||
},
|
||||
}
|
||||
|
||||
this.Controller.addSeatsToGroupSubscription(this.req, res)
|
||||
})
|
||||
})
|
||||
|
||||
describe('previewAddSeatsSubscriptionChange', function () {
|
||||
|
||||
@@ -506,22 +506,6 @@ describe('SubscriptionGroupHandler', function () {
|
||||
})
|
||||
})
|
||||
|
||||
describe('ensureAddSeatsEnabled', function () {
|
||||
it('should throw if the subscription can not use the "add seats" feature', async function () {
|
||||
await expect(
|
||||
this.Handler.promises.ensureAddSeatsEnabled({})
|
||||
).to.be.rejectedWith('The group plan does not support adding seats')
|
||||
})
|
||||
|
||||
it('should not throw if the subscription can use the "add seats" feature', async function () {
|
||||
await expect(
|
||||
this.Handler.promises.ensureAddSeatsEnabled({
|
||||
membersLimitAddOn: this.RecurlyEntities.MEMBERS_LIMIT_ADD_ON_CODE,
|
||||
})
|
||||
).to.not.be.rejected
|
||||
})
|
||||
})
|
||||
|
||||
describe('upgradeGroupPlan', function () {
|
||||
it('should upgrade the subscription for flexible licensing group plans', async function () {
|
||||
this.SubscriptionLocator.promises.getUsersSubscription = sinon
|
||||
|
||||
Reference in New Issue
Block a user