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:
ilkin-overleaf
2025-02-05 09:05:41 +00:00
committed by Copybot
parent d9febc168e
commit fb8794921e
6 changed files with 67 additions and 56 deletions
@@ -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)