mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 04:41:32 +02:00
Set Prettier's "trailingComma" setting to "es5" GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
36 lines
980 B
JavaScript
36 lines
980 B
JavaScript
const sinon = require('sinon')
|
|
const modulePath = '../../../../app/src/Features/User/UserHandler.js'
|
|
const SandboxedModule = require('sandboxed-module')
|
|
|
|
describe('UserHandler', function () {
|
|
beforeEach(function () {
|
|
this.user = {
|
|
_id: '12390i',
|
|
email: 'bob@bob.com',
|
|
remove: sinon.stub().callsArgWith(0),
|
|
}
|
|
|
|
this.TeamInvitesHandler = {
|
|
createTeamInvitesForLegacyInvitedEmail: sinon.stub().yields(),
|
|
}
|
|
|
|
this.UserHandler = SandboxedModule.require(modulePath, {
|
|
requires: {
|
|
'../Subscription/TeamInvitesHandler': this.TeamInvitesHandler,
|
|
},
|
|
})
|
|
})
|
|
|
|
describe('populateTeamInvites', function () {
|
|
beforeEach(function (done) {
|
|
this.UserHandler.populateTeamInvites(this.user, done)
|
|
})
|
|
|
|
it('notifies the user about legacy team invites', function () {
|
|
this.TeamInvitesHandler.createTeamInvitesForLegacyInvitedEmail
|
|
.calledWith(this.user.email)
|
|
.should.eq(true)
|
|
})
|
|
})
|
|
})
|