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
83e3312fd8
commit
c8ad331551
2 changed files with 6 additions and 6 deletions
|
@ -11,7 +11,7 @@ describe "DocumentUpdaterController", ->
|
|||
@callback = sinon.stub()
|
||||
@io = { "mock": "socket.io" }
|
||||
@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 =
|
||||
redis:
|
||||
documentupdater:
|
||||
|
@ -125,8 +125,8 @@ describe "DocumentUpdaterController", ->
|
|||
clients: sinon.stub().returns(@clients)
|
||||
@EditorUpdatesController._processErrorFromDocumentUpdater @io, @doc_id, "Something went wrong"
|
||||
|
||||
it "should log out an error", ->
|
||||
@logger.error.called.should.equal true
|
||||
it "should log a warning", ->
|
||||
@logger.warn.called.should.equal true
|
||||
|
||||
it "should disconnect all clients in that document", ->
|
||||
@io.sockets.clients.calledWith(@doc_id).should.equal true
|
||||
|
|
|
@ -32,7 +32,7 @@ describe 'WebsocketController', ->
|
|||
"./DocumentUpdaterManager": @DocumentUpdaterManager = {}
|
||||
"./ConnectedUsersManager": @ConnectedUsersManager = {}
|
||||
"./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 =
|
||||
inc: sinon.stub()
|
||||
set: sinon.stub()
|
||||
|
@ -514,8 +514,8 @@ describe 'WebsocketController', ->
|
|||
# it "should disconnect the client", ->
|
||||
# @client.disconnect.called.should.equal true
|
||||
|
||||
it "should log an error", ->
|
||||
@logger.error.called.should.equal true
|
||||
it "should log a warning", ->
|
||||
@logger.warn.called.should.equal true
|
||||
|
||||
it "should call the callback with the error", ->
|
||||
@callback.calledWith(@error).should.equal true
|
||||
|
|
Loading…
Reference in a new issue