mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Fix tests
GitOrigin-RevId: db5505ce356a88cb572c86affebebdd7b9e68ba9
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user