mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
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:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user