mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
fix tests
This commit is contained in:
@@ -61,8 +61,10 @@ describe "DocArchiveManager", ->
|
||||
beforeEach ->
|
||||
@update = { _id: ObjectId(), op: "op", meta: "meta", v: "v"}
|
||||
@MongoManager.getDocChangesCount = sinon.stub().callsArg(1)
|
||||
@MongoManager.getArchivedDocChanges = sinon.stub().callsArgWith(1, null, 0)
|
||||
@MongoManager.getLastCompressedUpdate = sinon.stub().callsArgWith(1, null, @update)
|
||||
@MongoAWS.archiveDocHistory = sinon.stub().callsArg(2)
|
||||
@MongoAWS.archiveDocHistory = sinon.stub().callsArg(3)
|
||||
@MongoManager.markDocHistoryAsArchiveInProgress = sinon.stub().callsArg(2)
|
||||
@MongoManager.markDocHistoryAsArchived = sinon.stub().callsArg(2)
|
||||
@DocArchiveManager.archiveDocChanges @project_id, @doc_id, @callback
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ describe "MongoAWS", ->
|
||||
|
||||
@project_id = ObjectId().toString()
|
||||
@doc_id = ObjectId().toString()
|
||||
@update = { v:123 }
|
||||
@callback = sinon.stub()
|
||||
|
||||
describe "archiveDocHistory", ->
|
||||
@@ -46,7 +47,7 @@ describe "MongoAWS", ->
|
||||
cb()
|
||||
@JSONStream.stringify = sinon.stub()
|
||||
|
||||
@MongoAWS.archiveDocHistory @project_id, @doc_id, @callback
|
||||
@MongoAWS.archiveDocHistory @project_id, @doc_id, @update, @callback
|
||||
|
||||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
|
||||
@@ -446,7 +446,7 @@ describe "MongoManager", ->
|
||||
@db.docHistory.count
|
||||
.calledWith({
|
||||
doc_id: ObjectId(@doc_id)
|
||||
inS3 : true
|
||||
inS3: {$exists: true}
|
||||
}, {
|
||||
})
|
||||
.should.equal true
|
||||
|
||||
Reference in New Issue
Block a user