mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Merge pull request #27017 from overleaf/ii-flexible-licensing-manually-billed-users-add-seats-revert
[web] Revert "FL manually billed subscriptions with no upsell" GitOrigin-RevId: 3ce5441f825f9a364d3c17e3ac09aa3b9e87b0e7
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