mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-01 10:43:37 +00:00
fix unit tests
This commit is contained in:
parent
83e3312fd8
commit
c8ad331551
2 changed files with 6 additions and 6 deletions
|
@ -11,7 +11,7 @@ describe "DocumentUpdaterController", ->
|
||||||
@callback = sinon.stub()
|
@callback = sinon.stub()
|
||||||
@io = { "mock": "socket.io" }
|
@io = { "mock": "socket.io" }
|
||||||
@EditorUpdatesController = SandboxedModule.require modulePath, requires:
|
@EditorUpdatesController = SandboxedModule.require modulePath, requires:
|
||||||
"logger-sharelatex": @logger = { error: sinon.stub(), log: sinon.stub() }
|
"logger-sharelatex": @logger = { error: sinon.stub(), log: sinon.stub(), warn: sinon.stub() }
|
||||||
"settings-sharelatex": @settings =
|
"settings-sharelatex": @settings =
|
||||||
redis:
|
redis:
|
||||||
documentupdater:
|
documentupdater:
|
||||||
|
@ -125,8 +125,8 @@ describe "DocumentUpdaterController", ->
|
||||||
clients: sinon.stub().returns(@clients)
|
clients: sinon.stub().returns(@clients)
|
||||||
@EditorUpdatesController._processErrorFromDocumentUpdater @io, @doc_id, "Something went wrong"
|
@EditorUpdatesController._processErrorFromDocumentUpdater @io, @doc_id, "Something went wrong"
|
||||||
|
|
||||||
it "should log out an error", ->
|
it "should log a warning", ->
|
||||||
@logger.error.called.should.equal true
|
@logger.warn.called.should.equal true
|
||||||
|
|
||||||
it "should disconnect all clients in that document", ->
|
it "should disconnect all clients in that document", ->
|
||||||
@io.sockets.clients.calledWith(@doc_id).should.equal true
|
@io.sockets.clients.calledWith(@doc_id).should.equal true
|
||||||
|
|
|
@ -32,7 +32,7 @@ describe 'WebsocketController', ->
|
||||||
"./DocumentUpdaterManager": @DocumentUpdaterManager = {}
|
"./DocumentUpdaterManager": @DocumentUpdaterManager = {}
|
||||||
"./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(), warn: sinon.stub() }
|
||||||
"metrics-sharelatex": @metrics =
|
"metrics-sharelatex": @metrics =
|
||||||
inc: sinon.stub()
|
inc: sinon.stub()
|
||||||
set: sinon.stub()
|
set: sinon.stub()
|
||||||
|
@ -514,8 +514,8 @@ describe 'WebsocketController', ->
|
||||||
# it "should disconnect the client", ->
|
# it "should disconnect the client", ->
|
||||||
# @client.disconnect.called.should.equal true
|
# @client.disconnect.called.should.equal true
|
||||||
|
|
||||||
it "should log an error", ->
|
it "should log a warning", ->
|
||||||
@logger.error.called.should.equal true
|
@logger.warn.called.should.equal true
|
||||||
|
|
||||||
it "should call the callback with the error", ->
|
it "should call the callback with the error", ->
|
||||||
@callback.calledWith(@error).should.equal true
|
@callback.calledWith(@error).should.equal true
|
||||||
|
|
Loading…
Reference in a new issue