Merge pull request #26829 from overleaf/ii-flexible-licensing-manually-billed-users-add-seats

[web] FL manually billed subscriptions with no upsell

GitOrigin-RevId: b5f2083c7eabd0a1a5d024d5699d2c5e5556671a
This commit is contained in:
ilkin-overleaf
2025-07-09 08:06:44 +00:00
committed by Copybot
parent 9b43b82c95
commit aa9dcb19a3
8 changed files with 108 additions and 6 deletions
@@ -73,6 +73,8 @@ describe('SubscriptionGroupController', function () {
.resolves(ctx.previewSubscriptionChangeData),
checkBillingInfoExistence: sinon.stub().resolves(ctx.paymentMethod),
updateSubscriptionPaymentTerms: sinon.stub().resolves(),
ensureSubscriptionHasAdditionalLicenseAddOnWhenCollectionMethodIsManual:
sinon.stub().resolves(),
},
}
@@ -140,6 +142,7 @@ describe('SubscriptionGroupController', function () {
InactiveError: class extends Error {},
SubtotalLimitExceededError: class extends Error {},
HasPastDueInvoiceError: class extends Error {},
HasNoAdditionalLicenseWhenManuallyCollectedError: class extends Error {},
}
vi.doMock(
@@ -521,6 +524,28 @@ describe('SubscriptionGroupController', function () {
})
})
it('should redirect to manually collected subscription error page when collection method is manual and has no additional license add-on', async function (ctx) {
await new Promise(resolve => {
ctx.SubscriptionGroupHandler.promises.ensureSubscriptionHasAdditionalLicenseAddOnWhenCollectionMethodIsManual =
sinon
.stub()
.throws(
new ctx.Errors.HasNoAdditionalLicenseWhenManuallyCollectedError()
)
const res = {
redirect: url => {
url.should.equal(
'/user/subscription/group/manually-collected-subscription'
)
resolve()
},
}
ctx.Controller.addSeatsToGroupSubscription(ctx.req, res)
})
})
it('should redirect to subscription page when there is a pending change', async function (ctx) {
await new Promise(resolve => {
ctx.SubscriptionGroupHandler.promises.ensureSubscriptionHasNoPendingChanges =