mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #17686 from overleaf/em-promisify-document-manager
Promisify DocumentManager GitOrigin-RevId: 63a28ef292b5aee708637ebcb53a5cbea7a304e6
This commit is contained in:
@@ -705,12 +705,9 @@ describe('UpdateManager', function () {
|
||||
|
||||
describe('lockUpdatesAndDo', function () {
|
||||
beforeEach(function () {
|
||||
this.method = sinon
|
||||
.stub()
|
||||
.yields(null, this.response_arg1, this.response_arg2)
|
||||
this.methodResult = 'method result'
|
||||
this.method = sinon.stub().resolves(this.methodResult)
|
||||
this.arg1 = 'argument 1'
|
||||
this.response_arg1 = 'response argument 1'
|
||||
this.response_arg2 = 'response argument 2'
|
||||
})
|
||||
|
||||
describe('successfully', function () {
|
||||
@@ -749,10 +746,7 @@ describe('UpdateManager', function () {
|
||||
})
|
||||
|
||||
it('should return the method response arguments', function () {
|
||||
expect(this.response).to.deep.equal([
|
||||
this.response_arg1,
|
||||
this.response_arg2,
|
||||
])
|
||||
expect(this.response).to.equal(this.methodResult)
|
||||
})
|
||||
|
||||
it('should release the lock', function () {
|
||||
@@ -797,7 +791,7 @@ describe('UpdateManager', function () {
|
||||
this.UpdateManager.promises.processOutstandingUpdates = sinon
|
||||
.stub()
|
||||
.resolves()
|
||||
this.method = sinon.stub().yields(this.error)
|
||||
this.method = sinon.stub().rejects(this.error)
|
||||
await expect(
|
||||
this.UpdateManager.promises.lockUpdatesAndDo(
|
||||
this.method,
|
||||
|
||||
Reference in New Issue
Block a user