mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Fix unit tests
This commit is contained in:
parent
11667e8250
commit
1d7cbd8a78
1 changed files with 4 additions and 3 deletions
|
@ -3,6 +3,7 @@ chai = require('chai')
|
|||
should = chai.should()
|
||||
modulePath = "../../../../app/js/RedisManager"
|
||||
SandboxedModule = require('sandboxed-module')
|
||||
Errors = require "../../../../app/js/Errors"
|
||||
|
||||
describe "RedisManager.getPreviousDocOpsTests", ->
|
||||
beforeEach ->
|
||||
|
@ -13,7 +14,7 @@ describe "RedisManager.getPreviousDocOpsTests", ->
|
|||
@rclient ?=
|
||||
auth: ->
|
||||
multi: => @rclient
|
||||
"logger-sharelatex": @logger = { error: sinon.stub(), log: sinon.stub() }
|
||||
"logger-sharelatex": @logger = { error: sinon.stub(), log: sinon.stub(), warn: sinon.stub() }
|
||||
@doc_id = "doc-id-123"
|
||||
|
||||
describe "with a start and an end value", ->
|
||||
|
@ -94,7 +95,7 @@ describe "RedisManager.getPreviousDocOpsTests", ->
|
|||
@RedisManager.getPreviousDocOps(@doc_id, @start, @end, @callback)
|
||||
|
||||
it "should return an error", ->
|
||||
@callback.calledWith(new Error("range is not loaded in redis")).should.equal true
|
||||
@callback.calledWith(new Errors.OpRangeNotAvailableError("doc ops range is not loaded in redis")).should.equal true
|
||||
|
||||
it "should log out the problem", ->
|
||||
@logger.error.called.should.equal true
|
||||
@logger.warn.called.should.equal true
|
||||
|
|
Loading…
Reference in a new issue