mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Ensure version is still returned from redis
This commit is contained in:
@@ -309,7 +309,7 @@ describe "DocOpsManager", ->
|
||||
describe "pushDocOp", ->
|
||||
beforeEach ->
|
||||
@op = "mock-op"
|
||||
@RedisManager.pushDocOp = sinon.stub().callsArg(2)
|
||||
@RedisManager.pushDocOp = sinon.stub().callsArgWith(2, null, @version = 42)
|
||||
@RedisManager.pushUncompressedHistoryOp = sinon.stub().callsArg(2)
|
||||
@DocOpsManager.pushDocOp @project_id, @doc_id, @op, @callback
|
||||
|
||||
@@ -323,7 +323,7 @@ describe "DocOpsManager", ->
|
||||
.calledWith(@doc_id, @op)
|
||||
.should.equal true
|
||||
|
||||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
it "should call the callback with the version", ->
|
||||
@callback.calledWith(null, @version).should.equal true
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,8 @@ describe "ShareJsDB.writeOps", ->
|
||||
@ShareJsDB.writeOp @doc_key, @opData, @callback
|
||||
|
||||
it "should write the op to redis", ->
|
||||
op =
|
||||
op: @opData.op
|
||||
meta: @opData.meta
|
||||
@DocOpsManager.pushDocOp
|
||||
.calledWith(@project_id, @doc_id, op)
|
||||
.calledWith(@project_id, @doc_id, @opData)
|
||||
.should.equal true
|
||||
|
||||
it "should call the callback without an error", ->
|
||||
@@ -46,7 +43,7 @@ describe "ShareJsDB.writeOps", ->
|
||||
@ShareJsDB.writeOp @doc_key, @opData, @callback
|
||||
|
||||
it "should call the callback with an error", ->
|
||||
@callback.calledWith(sinon.match.string).should.equal true
|
||||
@callback.calledWith(new Error()).should.equal true
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user