mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #8731 from overleaf/bg-return-not-found
[track-changes] return NotFoundError in DocumentUpdaterManager GitOrigin-RevId: df09294d00fce0649557581554d1b7bbd88af419
This commit is contained in:
+19
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user