mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
working on packmanager tests
This commit is contained in:
parent
f6367e21b8
commit
6d43273f04
1 changed files with 61 additions and 0 deletions
|
@ -237,3 +237,64 @@ describe "PackManager", ->
|
|||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
|
||||
|
||||
describe "getOpsByVersionRange", ->
|
||||
|
||||
describe "loadPacksByVersionRange", ->
|
||||
|
||||
describe "fetchPacksIfNeeded", ->
|
||||
|
||||
describe "makeProjectIterator", ->
|
||||
|
||||
describe "getPackById", ->
|
||||
|
||||
describe "increaseTTL", ->
|
||||
|
||||
describe "getIndex", ->
|
||||
|
||||
describe "getPackFromIndex", ->
|
||||
# getLastPackFromIndex:
|
||||
# getIndexWithKeys
|
||||
# initialiseIndex
|
||||
# updateIndex
|
||||
# findCompletedPacks
|
||||
# findUnindexedPacks
|
||||
# insertPacksIntoIndexWithLock
|
||||
# _insertPacksIntoIndex
|
||||
# archivePack
|
||||
# checkArchivedPack
|
||||
# processOldPack
|
||||
# updateIndexIfNeeded
|
||||
# findUnarchivedPacks
|
||||
|
||||
describe "checkArchiveNotInProgress", ->
|
||||
|
||||
describe "when an archive is in progress", ->
|
||||
beforeEach ->
|
||||
@db.docHistoryIndex =
|
||||
findOne: sinon.stub().callsArgWith(2, null, {inS3:false})
|
||||
@PackManager.checkArchiveNotInProgress @project_id, @doc_id, @pack_id, @callback
|
||||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
it "should return an error", ->
|
||||
@callback.calledWith(new Error()).should.equal true
|
||||
|
||||
describe "when an archive is completed", ->
|
||||
beforeEach ->
|
||||
@db.docHistoryIndex =
|
||||
findOne: sinon.stub().callsArgWith(2, null, {inS3:true})
|
||||
@PackManager.checkArchiveNotInProgress @project_id, @doc_id, @pack_id, @callback
|
||||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
it "should return an error", ->
|
||||
@callback.calledWith(new Error()).should.equal true
|
||||
|
||||
describe "when the archive has not started or completed", ->
|
||||
beforeEach ->
|
||||
@db.docHistoryIndex =
|
||||
findOne: sinon.stub().callsArgWith(2, null, {})
|
||||
@PackManager.checkArchiveNotInProgress @project_id, @doc_id, @pack_id, @callback
|
||||
it "should call the callback", ->
|
||||
@callback.called.should.equal true
|
||||
it "should return with no error", ->
|
||||
@callback.calledWith(undefined).should.equal true
|
||||
|
|
Loading…
Reference in a new issue