|
@@ -29,7 +29,6 @@ describe 'WebsocketController', ->
|
|
|
"./WebApiManager": @WebApiManager = {}
|
|
"./WebApiManager": @WebApiManager = {}
|
|
|
"./AuthorizationManager": @AuthorizationManager = {}
|
|
"./AuthorizationManager": @AuthorizationManager = {}
|
|
|
"./DocumentUpdaterManager": @DocumentUpdaterManager = {}
|
|
"./DocumentUpdaterManager": @DocumentUpdaterManager = {}
|
|
|
- "./TrackChangesManager": @TrackChangesManager = {}
|
|
|
|
|
"./ConnectedUsersManager": @ConnectedUsersManager = {}
|
|
"./ConnectedUsersManager": @ConnectedUsersManager = {}
|
|
|
"./WebsocketLoadBalancer": @WebsocketLoadBalancer = {}
|
|
"./WebsocketLoadBalancer": @WebsocketLoadBalancer = {}
|
|
|
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
|
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
|
|
@@ -120,7 +119,6 @@ describe 'WebsocketController', ->
|
|
|
describe "leaveProject", ->
|
|
describe "leaveProject", ->
|
|
|
beforeEach ->
|
|
beforeEach ->
|
|
|
@DocumentUpdaterManager.flushProjectToMongoAndDelete = sinon.stub().callsArg(1)
|
|
@DocumentUpdaterManager.flushProjectToMongoAndDelete = sinon.stub().callsArg(1)
|
|
|
- @TrackChangesManager.flushProject = sinon.stub().callsArg(1)
|
|
|
|
|
@ConnectedUsersManager.markUserAsDisconnected = sinon.stub().callsArg(2)
|
|
@ConnectedUsersManager.markUserAsDisconnected = sinon.stub().callsArg(2)
|
|
|
@WebsocketLoadBalancer.emitToRoom = sinon.stub()
|
|
@WebsocketLoadBalancer.emitToRoom = sinon.stub()
|
|
|
@clientsInRoom = []
|
|
@clientsInRoom = []
|
|
@@ -154,11 +152,6 @@ describe 'WebsocketController', ->
|
|
|
.calledWith(@project_id)
|
|
.calledWith(@project_id)
|
|
|
.should.equal true
|
|
.should.equal true
|
|
|
|
|
|
|
|
- it "should flush the changes in the track changes api", ->
|
|
|
|
|
- @TrackChangesManager.flushProject
|
|
|
|
|
- .calledWith(@project_id)
|
|
|
|
|
- .should.equal true
|
|
|
|
|
-
|
|
|
|
|
it "should increment the leave-project metric", ->
|
|
it "should increment the leave-project metric", ->
|
|
|
@metrics.inc.calledWith("editor.leave-project").should.equal true
|
|
@metrics.inc.calledWith("editor.leave-project").should.equal true
|
|
|
|
|
|
|
@@ -170,10 +163,6 @@ describe 'WebsocketController', ->
|
|
|
it "should not flush the project in the document updater", ->
|
|
it "should not flush the project in the document updater", ->
|
|
|
@DocumentUpdaterManager.flushProjectToMongoAndDelete
|
|
@DocumentUpdaterManager.flushProjectToMongoAndDelete
|
|
|
.called.should.equal false
|
|
.called.should.equal false
|
|
|
-
|
|
|
|
|
- it "should not flush the changes in the track changes api", ->
|
|
|
|
|
- @TrackChangesManager.flushProject
|
|
|
|
|
- .called.should.equal false
|
|
|
|
|
|
|
|
|
|
describe "joinDoc", ->
|
|
describe "joinDoc", ->
|
|
|
beforeEach ->
|
|
beforeEach ->
|