mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #17655 from overleaf/em-doc-length-fix
Fix doc length reporting in document-updater GitOrigin-RevId: 37a9c35e3510f7b5be233fff817c89eeff1cb296
This commit is contained in:
@@ -678,6 +678,29 @@ describe('UpdateManager', function () {
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
it('should calculate the right doc length for an empty document', function () {
|
||||
this.historyUpdates = [{ v: 42, op: [{ i: 'foobar', p: 0 }] }]
|
||||
this.UpdateManager._adjustHistoryUpdatesMetadata(
|
||||
this.historyUpdates,
|
||||
this.pathname,
|
||||
this.projectHistoryId,
|
||||
[],
|
||||
{},
|
||||
false
|
||||
)
|
||||
this.historyUpdates.should.deep.equal([
|
||||
{
|
||||
projectHistoryId: this.projectHistoryId,
|
||||
v: 42,
|
||||
op: [{ i: 'foobar', p: 0 }],
|
||||
meta: {
|
||||
pathname: this.pathname,
|
||||
doc_length: 0,
|
||||
},
|
||||
},
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('lockUpdatesAndDo', function () {
|
||||
|
||||
Reference in New Issue
Block a user