mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-27 07:14:10 +00:00
Fix unit tests
This commit is contained in:
parent
08f702a7c5
commit
d599cfa7ac
1 changed files with 3 additions and 2 deletions
|
@ -296,6 +296,7 @@ describe "EditorController", ->
|
||||||
@email = "Jane.Doe@example.com"
|
@email = "Jane.Doe@example.com"
|
||||||
@priveleges = "readOnly"
|
@priveleges = "readOnly"
|
||||||
@addedUser = { _id: "added-user" }
|
@addedUser = { _id: "added-user" }
|
||||||
|
@ProjectEditorHandler.buildUserModelView = sinon.stub().returns(@addedUser)
|
||||||
@CollaboratorsHandler.addUserToProject = sinon.stub().callsArgWith(3, null, @addedUser)
|
@CollaboratorsHandler.addUserToProject = sinon.stub().callsArgWith(3, null, @addedUser)
|
||||||
@EditorRealTimeController.emitToRoom = sinon.stub()
|
@EditorRealTimeController.emitToRoom = sinon.stub()
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
|
@ -314,9 +315,9 @@ describe "EditorController", ->
|
||||||
@EditorRealTimeController.emitToRoom.calledWith(@project_id, "userAddedToProject", @addedUser).should.equal true
|
@EditorRealTimeController.emitToRoom.calledWith(@project_id, "userAddedToProject", @addedUser).should.equal true
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it "should return true to the callback", (done)->
|
it "should return the user to the callback", (done)->
|
||||||
@EditorController.addUserToProject @project_id, @email, @priveleges, (err, result)=>
|
@EditorController.addUserToProject @project_id, @email, @priveleges, (err, result)=>
|
||||||
result.should.equal true
|
result.should.equal @addedUser
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue