optimize rootDoc_id validation

GitOrigin-RevId: f19d02674f7d0d47531be7586bc47628601a7231
This commit is contained in:
Ersun Warncke
2020-02-06 04:18:53 +00:00
committed by Copybot
parent 9d1ac41777
commit b493f91c45
3 changed files with 102 additions and 64 deletions
@@ -24,6 +24,9 @@ describe('ClsiManager', function() {
this.DocumentUpdaterHandler = {
getProjectDocsIfMatch: sinon.stub().callsArgWith(2, null, null)
}
this.ProjectRootDocManager = {
setRootDocAutomatically: sinon.stub().yields()
}
this.logger = {
log: sinon.stub(),
error: sinon.stub(),
@@ -63,6 +66,7 @@ describe('ClsiManager', function() {
},
'../Project/ProjectEntityHandler': this.ProjectEntityHandler,
'../Project/ProjectGetter': this.ProjectGetter,
'../Project/ProjectRootDocManager': this.ProjectRootDocManager,
'../DocumentUpdater/DocumentUpdaterHandler': this
.DocumentUpdaterHandler,
'./ClsiCookieManager': () => this.ClsiCookieManager,
@@ -76,7 +76,7 @@ describe('CompileManager', function() {
this.CompileManager._checkIfRecentlyCompiled = sinon
.stub()
.callsArgWith(2, null, false)
this.ProjectRootDocManager.ensureRootDocumentIsValid = sinon
this.ProjectRootDocManager.ensureRootDocumentIsSet = sinon
.stub()
.callsArgWith(1, null)
this.CompileManager.getProjectCompileLimits = sinon
@@ -115,7 +115,7 @@ describe('CompileManager', function() {
})
it('should ensure that the root document is set', function() {
return this.ProjectRootDocManager.ensureRootDocumentIsValid
return this.ProjectRootDocManager.ensureRootDocumentIsSet
.calledWith(this.project_id)
.should.equal(true)
})