Merge pull request #12848 from overleaf/bg-fix-path-exception

add exception handling for  path.join in ProjectEntityHandler

GitOrigin-RevId: dad305057fd6b2821525ca5b6d1933824989e241
This commit is contained in:
Brian Gough
2023-05-02 09:18:57 +01:00
committed by Copybot
parent b8ebb5cd9e
commit 0367deb018
7 changed files with 291 additions and 27 deletions

View File

@@ -1558,6 +1558,17 @@ describe('ProjectController', function () {
}
this.ProjectController.projectEntitiesJson(this.req, this.res, this.next)
})
it('should call next with an error if the project file tree is invalid', function (done) {
this.ProjectEntityHandler.getAllEntitiesFromProject = sinon
.stub()
.throws()
this.next = err => {
expect(err).to.be.an.instanceof(Error)
done()
}
this.ProjectController.projectEntitiesJson(this.req, this.res, this.next)
})
})
describe('_buildProjectViewModel', function () {