Merge pull request #16821 from overleaf/em-promisify-ranges-manager

Make RangesManager synchronous

GitOrigin-RevId: 46bc85d952474fa0d83f3fd1299c0a3888fcf436
This commit is contained in:
Eric Mc Sween
2024-02-09 09:04:31 +00:00
committed by Copybot
parent 63520c7076
commit 0ffcbb96f6
6 changed files with 171 additions and 286 deletions
@@ -65,9 +65,7 @@ describe('UpdateManager', function () {
}
this.RangesManager = {
promises: {
applyUpdate: sinon.stub(),
},
applyUpdate: sinon.stub(),
}
this.SnapshotManager = {
@@ -320,7 +318,7 @@ describe('UpdateManager', function () {
pathname: this.pathname,
projectHistoryId: this.projectHistoryId,
})
this.RangesManager.promises.applyUpdate.resolves({
this.RangesManager.applyUpdate.returns({
newRanges: this.updated_ranges,
rangesWereCollapsed: false,
})
@@ -357,7 +355,7 @@ describe('UpdateManager', function () {
})
it('should update the ranges', function () {
this.RangesManager.promises.applyUpdate
this.RangesManager.applyUpdate
.calledWith(
this.project_id,
this.doc_id,
@@ -444,7 +442,7 @@ describe('UpdateManager', function () {
describe('when ranges get collapsed', function () {
beforeEach(async function () {
this.RangesManager.promises.applyUpdate.resolves({
this.RangesManager.applyUpdate.returns({
newRanges: this.updated_ranges,
rangesWereCollapsed: true,
})