mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 12:24:25 +02:00
Merge pull request #2988 from overleaf/msm-oerror-remove-not-found-error
Replace HTTPErrors.NotFoundError with calls to notFound() handler GitOrigin-RevId: c98582a5bd3d862b3c17fb03d863c75f64851aba
This commit is contained in:
@@ -123,6 +123,7 @@ describe('EditorHttpController', function() {
|
||||
}
|
||||
}
|
||||
this.HttpErrorHandler = {
|
||||
notFound: sinon.stub(),
|
||||
unprocessableEntity: sinon.stub()
|
||||
}
|
||||
this.EditorHttpController = SandboxedModule.require(MODULE_PATH, {
|
||||
@@ -559,5 +560,20 @@ describe('EditorHttpController', function() {
|
||||
this.EditorHttpController.convertDocToFile(this.req, this.res)
|
||||
})
|
||||
})
|
||||
|
||||
describe("when the doc does't exist", function() {
|
||||
it('should return a 404 - not found', function(done) {
|
||||
this.ProjectEntityUpdateHandler.promises.convertDocToFile.rejects(
|
||||
new Errors.NotFoundError({})
|
||||
)
|
||||
this.HttpErrorHandler.notFound = sinon.spy((req, res, message) => {
|
||||
expect(req).to.exist
|
||||
expect(res).to.exist
|
||||
expect(message).to.equal('Document not found')
|
||||
done()
|
||||
})
|
||||
this.EditorHttpController.convertDocToFile(this.req, this.res)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user