add ensureRootDocumentIsValidForProject method

GitOrigin-RevId: 5b9191bce2fe1de85c573ed533521e53f08d146b
This commit is contained in:
Brian Gough
2020-01-29 11:46:28 +00:00
committed by Copybot
parent ffd9ec5537
commit 77ad61d86a
2 changed files with 49 additions and 47 deletions
@@ -575,13 +575,13 @@ describe('ProjectRootDocManager', function() {
describe('ensureRootDocumentIsValid', function() {
beforeEach(function() {
this.project = {}
this.project = { _id: this.project_id }
this.ProjectGetter.getProject = sinon
.stub()
.callsArgWith(2, null, this.project)
this.ProjectEntityUpdateHandler.setRootDoc = sinon.stub().yields()
this.ProjectEntityUpdateHandler.unsetRootDoc = sinon.stub().yields()
this.ProjectEntityHandler.getAllDocPathsFromProjectById = sinon
this.ProjectEntityHandler.getAllDocPathsFromProject = sinon
.stub()
.callsArgWith(1, null, this.docPaths)
return (this.ProjectRootDocManager.setRootDocAutomatically = sinon
@@ -599,9 +599,9 @@ describe('ProjectRootDocManager', function() {
)
})
it('should find the project fetching only the rootDoc_id field', function() {
it('should find the project fetching only the rootDoc_id and rootFolder fields', function() {
return this.ProjectGetter.getProject
.calledWith(this.project_id, { rootDoc_id: 1 })
.calledWith(this.project_id, { rootDoc_id: 1, rootFolder: 1 })
.should.equal(true)
})
@@ -625,9 +625,9 @@ describe('ProjectRootDocManager', function() {
)
})
it('should find the project fetching only the rootDoc_id field', function() {
it('should find the project fetching only the rootDoc_id and rootFolder fields', function() {
return this.ProjectGetter.getProject
.calledWith(this.project_id, { rootDoc_id: 1 })
.calledWith(this.project_id, { rootDoc_id: 1, rootFolder: 1 })
.should.equal(true)
})