Merge pull request #23314 from overleaf/ls-update-group-plan-upgrade-mapping
Update group plan upgrade mapping GitOrigin-RevId: aca3d986477dbcf0561635dfd771413a2ba1ef15
This commit is contained in:
@@ -280,19 +280,13 @@ describe('RecurlyEntities', function () {
|
||||
|
||||
describe('getRequestForGroupPlanUpgrade()', function () {
|
||||
it('returns a correct change request', function () {
|
||||
const changeRequest = this.subscription.getRequestForGroupPlanUpgrade(
|
||||
'test_plan_code',
|
||||
10
|
||||
)
|
||||
const changeRequest =
|
||||
this.subscription.getRequestForGroupPlanUpgrade('test_plan_code')
|
||||
const addOns = [
|
||||
new RecurlySubscriptionAddOnUpdate({
|
||||
code: 'add-on-code',
|
||||
quantity: 1,
|
||||
}),
|
||||
new RecurlySubscriptionAddOnUpdate({
|
||||
code: 'additional-license',
|
||||
quantity: 10,
|
||||
}),
|
||||
]
|
||||
expect(changeRequest).to.deep.equal(
|
||||
new RecurlySubscriptionChangeRequest({
|
||||
|
||||
@@ -71,6 +71,7 @@ describe('SubscriptionGroupHandler', function () {
|
||||
|
||||
this.SubscriptionController = {
|
||||
makeChangePreview: sinon.stub().resolves(this.changePreview),
|
||||
getPlanNameForDisplay: sinon.stub().resolves(),
|
||||
}
|
||||
|
||||
this.SubscriptionUpdater = {
|
||||
@@ -512,6 +513,9 @@ describe('SubscriptionGroupHandler', function () {
|
||||
.stub()
|
||||
.resolves({ groupPlan: true, planCode: 'group_collaborator' })
|
||||
await this.Handler.promises.upgradeGroupPlan(this.user_id)
|
||||
this.recurlySubscription.getRequestForGroupPlanUpgrade
|
||||
.calledWith('group_professional')
|
||||
.should.equal(true)
|
||||
this.RecurlyClient.promises.applySubscriptionChangeRequest
|
||||
.calledWith(this.changeRequest)
|
||||
.should.equal(true)
|
||||
@@ -528,6 +532,9 @@ describe('SubscriptionGroupHandler', function () {
|
||||
planCode: 'group_collaborator_10_educational',
|
||||
})
|
||||
await this.Handler.promises.upgradeGroupPlan(this.user_id)
|
||||
this.recurlySubscription.getRequestForGroupPlanUpgrade
|
||||
.calledWith('group_professional_10_educational')
|
||||
.should.equal(true)
|
||||
this.RecurlyClient.promises.applySubscriptionChangeRequest
|
||||
.calledWith(this.changeRequest)
|
||||
.should.equal(true)
|
||||
|
||||
Reference in New Issue
Block a user