Fix tests

GitOrigin-RevId: db5505ce356a88cb572c86affebebdd7b9e68ba9
This commit is contained in:
Andrew Rumble
2025-08-27 15:06:14 +01:00
committed by Copybot
parent 639fe0ca59
commit 665b80ed1e
2 changed files with 13 additions and 5 deletions
@@ -187,6 +187,14 @@ describe('SubscriptionController', function () {
refreshFeatures: sinon.stub().resolves({ features: {} }),
},
}),
celebrate: (this.celebrate = {
celebrate: sinon.stub(),
errors: sinon.stub(),
Joi: {
any: sinon.stub(),
extend: sinon.stub(),
},
}),
'./GroupPlansData': (this.GroupPlansData = {}),
'./V1SubscriptionManager': (this.V1SubscriptionManager = {}),
'../Errors/HttpErrorHandler': (this.HttpErrorHandler = {
@@ -1,4 +1,4 @@
import { vi } from 'vitest'
import { beforeEach, describe, it, vi } from 'vitest'
import sinon from 'sinon'
const modulePath =
@@ -612,14 +612,14 @@ describe('SubscriptionGroupController', function () {
})
it('should fail previewing "add seats" change', async function (ctx) {
await new Promise(resolve => {
ctx.SubscriptionGroupHandler.promises.previewAddSeatsSubscriptionChange =
sinon.stub().rejects()
ctx.SubscriptionGroupHandler.promises.previewAddSeatsSubscriptionChange =
sinon.stub().rejects()
ctx.req.body = { adding: 2 }
await new Promise(resolve => {
const res = {
status: statusCode => {
statusCode.should.equal(500)
return {
end: () => {
resolve()