Jelajahi Sumber

Fix unit tests

Shane Kilkelly 9 tahun lalu
induk
melakukan
c9432a1238

+ 1 - 1
services/web/test/UnitTests/coffee/Labels/LabelsControllerTests.coffee

@@ -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', ->

+ 2 - 2
services/web/test/UnitTests/coffee/Uploads/FileSystemImportManagerTests.coffee

@@ -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
 
 

+ 2 - 0
services/web/test/UnitTests/coffee/Uploads/ProjectUploadControllerTests.coffee

@@ -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