mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 02:13:35 -05:00
Merge pull request #19815 from overleaf/bg-fix-ranges-manager-unit-test
fix RangesManager unit test for mixed track changes GitOrigin-RevId: 8f12708261ce94bed0c80c29f4a05c94876a4e9d
This commit is contained in:
parent
2133dde8bf
commit
6290718b7e
1 changed files with 5 additions and 3 deletions
|
@ -970,7 +970,7 @@ describe('RangesManager', function () {
|
||||||
doc_length: 15,
|
doc_length: 15,
|
||||||
history_doc_length: 24,
|
history_doc_length: 24,
|
||||||
pathname: '',
|
pathname: '',
|
||||||
ts: ranges.changes[1].metadata.ts,
|
ts: ranges.changes[2].metadata.ts,
|
||||||
},
|
},
|
||||||
op: [
|
op: [
|
||||||
{
|
{
|
||||||
|
@ -988,7 +988,7 @@ describe('RangesManager', function () {
|
||||||
doc_length: 15,
|
doc_length: 15,
|
||||||
history_doc_length: 24,
|
history_doc_length: 24,
|
||||||
pathname: '',
|
pathname: '',
|
||||||
ts: ranges.changes[2].metadata.ts,
|
ts: ranges.changes[3].metadata.ts,
|
||||||
},
|
},
|
||||||
op: [
|
op: [
|
||||||
{
|
{
|
||||||
|
@ -1006,13 +1006,15 @@ describe('RangesManager', function () {
|
||||||
function makeRanges(ops) {
|
function makeRanges(ops) {
|
||||||
let id = 1
|
let id = 1
|
||||||
const changes = []
|
const changes = []
|
||||||
|
let ts = Date.now()
|
||||||
for (const op of ops) {
|
for (const op of ops) {
|
||||||
changes.push({
|
changes.push({
|
||||||
id: id.toString(),
|
id: id.toString(),
|
||||||
op,
|
op,
|
||||||
metadata: { user_id: TEST_USER_ID, ts: new Date() },
|
metadata: { user_id: TEST_USER_ID, ts: new Date(ts) },
|
||||||
})
|
})
|
||||||
id += 1
|
id += 1
|
||||||
|
ts += 1000 // use a unique timestamp for each change
|
||||||
}
|
}
|
||||||
return changes
|
return changes
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue