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

@@ -2374,6 +2374,24 @@ describe('ProjectEntityUpdateHandler', function () {
).to.have.been.calledWith(projectId, projectHistoryId, docs, files)
})
})
describe('a project with an invalid file tree', function () {
beforeEach(function () {
this.callback = sinon.stub()
this.ProjectGetter.getProject.yields(null, this.project)
this.ProjectEntityHandler.getAllEntitiesFromProject.throws()
this.ProjectEntityUpdateHandler.resyncProjectHistory(
projectId,
this.callback
)
})
it('calls the callback with an error', function () {
expect(this.callback).to.have.been.calledWith(
sinon.match.instanceOf(Error)
)
})
})
})
describe('_cleanUpEntity', function () {