mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 02:15:13 -05:00
Fix unit tests
This commit is contained in:
parent
355a5a020e
commit
d82ae02d23
1 changed files with 6 additions and 14 deletions
|
@ -180,21 +180,13 @@ describe 'project entity handler', ->
|
||||||
|
|
||||||
describe "a doc", ->
|
describe "a doc", ->
|
||||||
beforeEach (done) ->
|
beforeEach (done) ->
|
||||||
@ProjectEntityHandler._cleanUpEntity @project, _id: @entity_id, 'doc', done
|
@ProjectEntityHandler._cleanUpDoc = sinon.stub().callsArg(3)
|
||||||
|
@ProjectEntityHandler._cleanUpEntity @project, @entity = {_id: @entity_id}, 'doc', done
|
||||||
|
|
||||||
it "should not attempted to delete from FileStoreHandler", ->
|
it "should clean up the doc", ->
|
||||||
@FileStoreHandler.deleteFile.called.should.equal false
|
@ProjectEntityHandler._cleanUpDoc
|
||||||
|
.calledWith(@project, @entity)
|
||||||
it "should delete the doc from the document updater", ->
|
.should.equal true
|
||||||
@documentUpdaterHandler.deleteDoc.calledWith(project_id, @entity_id).should.equal true
|
|
||||||
|
|
||||||
describe "when the entity is the root document", ->
|
|
||||||
beforeEach (done) ->
|
|
||||||
@project.rootDoc_id = new ObjectId(@entity_id)
|
|
||||||
@ProjectEntityHandler._cleanUpEntity @project, _id: @entity_id, 'doc', done
|
|
||||||
|
|
||||||
it "should unset the root doc id", ->
|
|
||||||
@ProjectEntityHandler.unsetRootDoc.calledWith(project_id).should.equal true
|
|
||||||
|
|
||||||
describe "a folder", ->
|
describe "a folder", ->
|
||||||
beforeEach (done) ->
|
beforeEach (done) ->
|
||||||
|
|
Loading…
Reference in a new issue