From 6290718b7ea81a48575bc64b5b4968c73ea39093 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 7 Aug 2024 10:40:04 +0100 Subject: [PATCH] Merge pull request #19815 from overleaf/bg-fix-ranges-manager-unit-test fix RangesManager unit test for mixed track changes GitOrigin-RevId: 8f12708261ce94bed0c80c29f4a05c94876a4e9d --- .../test/unit/js/RangesManager/RangesManagerTests.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/document-updater/test/unit/js/RangesManager/RangesManagerTests.js b/services/document-updater/test/unit/js/RangesManager/RangesManagerTests.js index 7c4bd51229..352cbc0d05 100644 --- a/services/document-updater/test/unit/js/RangesManager/RangesManagerTests.js +++ b/services/document-updater/test/unit/js/RangesManager/RangesManagerTests.js @@ -970,7 +970,7 @@ describe('RangesManager', function () { doc_length: 15, history_doc_length: 24, pathname: '', - ts: ranges.changes[1].metadata.ts, + ts: ranges.changes[2].metadata.ts, }, op: [ { @@ -988,7 +988,7 @@ describe('RangesManager', function () { doc_length: 15, history_doc_length: 24, pathname: '', - ts: ranges.changes[2].metadata.ts, + ts: ranges.changes[3].metadata.ts, }, op: [ { @@ -1006,13 +1006,15 @@ describe('RangesManager', function () { function makeRanges(ops) { let id = 1 const changes = [] + let ts = Date.now() for (const op of ops) { changes.push({ id: id.toString(), op, - metadata: { user_id: TEST_USER_ID, ts: new Date() }, + metadata: { user_id: TEST_USER_ID, ts: new Date(ts) }, }) id += 1 + ts += 1000 // use a unique timestamp for each change } return changes }