mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Fix unit tests
This commit is contained in:
parent
1bb065344c
commit
c9432a1238
3 changed files with 5 additions and 3 deletions
|
@ -92,7 +92,7 @@ describe 'LabelsController', ->
|
|||
@EditorRealTimeController.emitToRoom.callCount.should.equal 1
|
||||
lastCall = @EditorRealTimeController.emitToRoom.lastCall
|
||||
expect(lastCall.args[0]).to.equal @projectId
|
||||
expect(lastCall.args[1]).to.equal 'doc:labels:updated'
|
||||
expect(lastCall.args[1]).to.equal 'docLabelsUpdated'
|
||||
expect(lastCall.args[2]).to.have.all.keys ['docId', 'labels']
|
||||
|
||||
describe 'when LabelsHandler.getLabelsForDoc produces an error', ->
|
||||
|
|
|
@ -255,7 +255,7 @@ describe "FileSystemImportManager", ->
|
|||
@FileSystemImportManager.addEntity @user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback
|
||||
|
||||
it "should call addFile", ->
|
||||
@FileSystemImportManager.addFile.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback)
|
||||
@FileSystemImportManager.addFile.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace)
|
||||
.should.equal true
|
||||
|
||||
describe "with text file", ->
|
||||
|
@ -267,7 +267,7 @@ describe "FileSystemImportManager", ->
|
|||
@FileSystemImportManager.addEntity @user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback
|
||||
|
||||
it "should call addFile", ->
|
||||
@FileSystemImportManager.addDoc.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace, @callback)
|
||||
@FileSystemImportManager.addDoc.calledWith(@user_id, @project_id, @folder_id, @name, @path_on_disk, @replace)
|
||||
.should.equal true
|
||||
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ describe "ProjectUploadController", ->
|
|||
beforeEach ->
|
||||
@entity =
|
||||
_id : "1234"
|
||||
type: 'file'
|
||||
@FileSystemImportManager.addEntity = sinon.stub().callsArgWith(6, null, @entity)
|
||||
@ProjectUploadController.uploadFile @req, @res
|
||||
|
||||
|
@ -133,6 +134,7 @@ describe "ProjectUploadController", ->
|
|||
expect(@res.body).to.deep.equal
|
||||
success: true
|
||||
entity_id: @entity._id
|
||||
entity_type: 'file'
|
||||
|
||||
it "should output a log line", ->
|
||||
@logger.log
|
||||
|
|
Loading…
Reference in a new issue