overleaf/services/web/test/unit/coffee/User/UserHandlerTests.coffee
Timothée Alby 9a0dd31d8c Merge pull request #1061 from sharelatex/ja-remove-domain-license-code
Remove deprecated domain license code

GitOrigin-RevId: c9eebe1a657b07b69d618cdb5e73b64782109714
2019-01-29 12:08:29 +00:00

28 lines
799 B
CoffeeScript

sinon = require('sinon')
chai = require('chai')
should = chai.should()
modulePath = "../../../../app/js/Features/User/UserHandler.js"
SandboxedModule = require('sandboxed-module')
describe "UserHandler", ->
beforeEach ->
@user =
_id:"12390i"
email: "bob@bob.com"
remove: sinon.stub().callsArgWith(0)
@TeamInvitesHandler =
createTeamInvitesForLegacyInvitedEmail: sinon.stub().yields()
@UserHandler = SandboxedModule.require modulePath, requires:
"../Subscription/TeamInvitesHandler": @TeamInvitesHandler
describe "populateTeamInvites", ->
beforeEach (done)->
@UserHandler.populateTeamInvites @user, done
it "notifies the user about legacy team invites", ->
@TeamInvitesHandler.createTeamInvitesForLegacyInvitedEmail
.calledWith(@user.email).should.eq true