Merge pull request #8731 from overleaf/bg-return-not-found

[track-changes] return NotFoundError in DocumentUpdaterManager

GitOrigin-RevId: df09294d00fce0649557581554d1b7bbd88af419
This commit is contained in:
Brian Gough
2022-07-07 08:03:19 +00:00
committed by Copybot
parent 8488068a82
commit 768a5a7d0f
2 changed files with 30 additions and 1 deletions
@@ -81,6 +81,25 @@ describe('DocumentUpdaterManager', function () {
})
})
describe('when the document updater returns not found', function () {
beforeEach(function () {
this.request.get = sinon
.stub()
.callsArgWith(1, null, { statusCode: 404 }, '')
return this.DocumentUpdaterManager.getDocument(
this.project_id,
this.doc_id,
this.callback
)
})
it('should return the callback with a "not found" error', function () {
return this.callback
.calledWith(sinon.match.has('message', 'doc not found'))
.should.equal(true)
})
})
return describe('when the document updater returns a failure error code', function () {
beforeEach(function () {
this.request.get = sinon