diff --git a/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js b/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js index 27faa41003..d585a59ab5 100644 --- a/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js +++ b/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js @@ -19,6 +19,7 @@ const modulePath = '../../../../app/src/Features/Authorization/AuthorizationManager.js' const SandboxedModule = require('sandboxed-module') const Errors = require('../../../../app/src/Features/Errors/Errors.js') +const { ObjectId } = require('mongodb') describe('AuthorizationManager', function() { beforeEach(function() { @@ -27,6 +28,7 @@ describe('AuthorizationManager', function() { console: console }, requires: { + mongodb: { ObjectId }, '../Collaborators/CollaboratorsGetter': (this.CollaboratorsGetter = {}), '../Collaborators/CollaboratorsHandler': (this.CollaboratorsHandler = {}), '../Project/ProjectGetter': (this.ProjectGetter = {}), diff --git a/services/web/test/unit/src/Collaborators/CollaboratorsControllerTests.js b/services/web/test/unit/src/Collaborators/CollaboratorsControllerTests.js index 3ca9131ec3..c105515198 100644 --- a/services/web/test/unit/src/Collaborators/CollaboratorsControllerTests.js +++ b/services/web/test/unit/src/Collaborators/CollaboratorsControllerTests.js @@ -61,6 +61,7 @@ describe('CollaboratorsController', function() { console: console }, requires: { + mongodb: { ObjectId }, './CollaboratorsHandler': this.CollaboratorsHandler, './CollaboratorsGetter': this.CollaboratorsGetter, './OwnershipTransferHandler': this.OwnershipTransferHandler, diff --git a/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js b/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js index 841a0941ed..8120a82ffd 100644 --- a/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js +++ b/services/web/test/unit/src/Collaborators/CollaboratorsGetterTests.js @@ -51,6 +51,7 @@ describe('CollaboratorsGetter', function() { console: console }, requires: { + mongodb: { ObjectId }, '../User/UserGetter': this.UserGetter, '../../models/Project': { Project }, '../Project/ProjectGetter': this.ProjectGetter, diff --git a/services/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js b/services/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js index b4cbeef99e..9e0a9980c4 100644 --- a/services/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js +++ b/services/web/test/unit/src/Project/ProjectCollabratecDetailsTest.js @@ -38,6 +38,7 @@ describe('ProjectCollabratecDetailsHandler', function() { console: console }, requires: { + mongodb: { ObjectId }, '../../models/Project': { Project: this.ProjectModel } } } diff --git a/services/web/test/unit/src/Project/ProjectControllerTests.js b/services/web/test/unit/src/Project/ProjectControllerTests.js index d0e6efddc1..36989169ad 100644 --- a/services/web/test/unit/src/Project/ProjectControllerTests.js +++ b/services/web/test/unit/src/Project/ProjectControllerTests.js @@ -137,6 +137,7 @@ describe('ProjectController', function() { console: console }, requires: { + mongodb: { ObjectId }, 'settings-sharelatex': this.settings, 'logger-sharelatex': { log() {}, diff --git a/services/web/test/unit/src/Project/ProjectCreationHandlerTests.js b/services/web/test/unit/src/Project/ProjectCreationHandlerTests.js index b29975f5b8..15eb06635e 100644 --- a/services/web/test/unit/src/Project/ProjectCreationHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectCreationHandlerTests.js @@ -4,6 +4,7 @@ const modulePath = '../../../../app/src/Features/Project/ProjectCreationHandler.js' const SandboxedModule = require('sandboxed-module') const Path = require('path') +const { ObjectId } = require('mongodb') describe('ProjectCreationHandler', function() { const ownerId = '4eecb1c1bffa66588e0000a1' @@ -64,6 +65,7 @@ describe('ProjectCreationHandler', function() { console: console }, requires: { + mongodb: { ObjectId }, '../../models/User': { User: this.User }, diff --git a/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js b/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js index 872792c79a..02ce519c77 100644 --- a/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js @@ -186,6 +186,7 @@ describe('ProjectEntityMongoUpdateHandler', function() { console: console }, requires: { + mongodb: { ObjectId }, 'logger-sharelatex': this.logger, 'settings-sharelatex': this.Settings, '../Cooldown/CooldownManager': this.CooldownManager, diff --git a/services/web/test/unit/src/Project/ProjectHelperTests.js b/services/web/test/unit/src/Project/ProjectHelperTests.js index 3e9ab30ff3..ac820585a6 100644 --- a/services/web/test/unit/src/Project/ProjectHelperTests.js +++ b/services/web/test/unit/src/Project/ProjectHelperTests.js @@ -36,6 +36,7 @@ describe('ProjectHelper', function() { this.ProjectHelper = SandboxedModule.require(MODULE_PATH, { requires: { + mongodb: { ObjectId }, 'settings-sharelatex': this.Settings } }) diff --git a/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js b/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js index 5b38e0b0d9..035dd95700 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js @@ -98,6 +98,7 @@ describe('SubscriptionUpdater', function() { console: console }, requires: { + mongodb: { ObjectId }, '../../models/Subscription': { Subscription: this.SubscriptionModel }, diff --git a/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js b/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js index 38a5a86801..925a4c1699 100644 --- a/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js +++ b/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js @@ -87,6 +87,7 @@ describe('TeamInvitesHandler', function() { console: console }, requires: { + mongodb: { ObjectId }, 'logger-sharelatex': { log() {} }, crypto: this.crypto, 'settings-sharelatex': { siteUrl: 'http://example.com' }, diff --git a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js index d5f76875a9..d85f54ff18 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js +++ b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js @@ -64,6 +64,7 @@ describe('TpdsUpdateSender', function() { console: console }, requires: { + mongodb: { ObjectId }, 'settings-sharelatex': this.settings, 'logger-sharelatex': { log() {} }, 'request-promise-native': this.request, diff --git a/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js b/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js index 8842460cf7..d17ed0e0ad 100644 --- a/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js +++ b/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js @@ -39,6 +39,7 @@ describe('TokenAccessHandler', function() { console: console }, requires: { + mongodb: { ObjectId }, '../../models/Project': { Project: (this.Project = {}) }, 'settings-sharelatex': (this.settings = {}), '../Collaborators/CollaboratorsGetter': (this.CollaboratorsGetter = {}), diff --git a/services/web/test/unit/src/User/UserInfoControllerTests.js b/services/web/test/unit/src/User/UserInfoControllerTests.js index 6a504940f0..3ce3ae1441 100644 --- a/services/web/test/unit/src/User/UserInfoControllerTests.js +++ b/services/web/test/unit/src/User/UserInfoControllerTests.js @@ -39,6 +39,7 @@ describe('UserInfoController', function() { console: console }, requires: { + mongodb: { ObjectId }, './UserGetter': this.UserGetter, './UserUpdater': this.UserUpdater, './UserDeleter': this.UserDeleter, diff --git a/services/web/test/unit/src/UserMembership/UserMembershipHandlerTests.js b/services/web/test/unit/src/UserMembership/UserMembershipHandlerTests.js index fe01f20f00..3cc8b19558 100644 --- a/services/web/test/unit/src/UserMembership/UserMembershipHandlerTests.js +++ b/services/web/test/unit/src/UserMembership/UserMembershipHandlerTests.js @@ -72,6 +72,7 @@ describe('UserMembershipHandler', function() { console: console }, requires: { + mongodb: { ObjectId }, './UserMembershipViewModel': this.UserMembershipViewModel, '../User/UserGetter': this.UserGetter, '../Errors/Errors': Errors, diff --git a/services/web/test/unit/src/UserMembership/UserMembershipViewModelTests.js b/services/web/test/unit/src/UserMembership/UserMembershipViewModelTests.js index a4146f7270..4fc46733b6 100644 --- a/services/web/test/unit/src/UserMembership/UserMembershipViewModelTests.js +++ b/services/web/test/unit/src/UserMembership/UserMembershipViewModelTests.js @@ -29,7 +29,7 @@ describe('UserMembershipViewModel', function() { console: console }, requires: { - mongodb: require('mongodb'), + mongodb: { ObjectId }, '../User/UserGetter': this.UserGetter } })