mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
fix tests
This commit is contained in:
parent
dc0044020f
commit
bdf1d267f0
3 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue