mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #18906 from overleaf/em-migrate-existing-histories-2
History ranges migration script - second attempt GitOrigin-RevId: 60a2c04e2a72e76a58e9e179fefc4186a96fde32
This commit is contained in:
@@ -18,6 +18,10 @@ const SandboxedModule = require('sandboxed-module')
|
||||
describe('ProjectManager - flushAndDeleteProject', function () {
|
||||
beforeEach(function () {
|
||||
let Timer
|
||||
this.LockManager = {
|
||||
getLock: sinon.stub().yields(),
|
||||
releaseLock: sinon.stub().yields(),
|
||||
}
|
||||
this.ProjectManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
'./RedisManager': (this.RedisManager = {}),
|
||||
@@ -26,6 +30,7 @@ describe('ProjectManager - flushAndDeleteProject', function () {
|
||||
'./HistoryManager': (this.HistoryManager = {
|
||||
flushProjectChanges: sinon.stub().callsArg(2),
|
||||
}),
|
||||
'./LockManager': this.LockManager,
|
||||
'./Metrics': (this.Metrics = {
|
||||
Timer: (Timer = (function () {
|
||||
Timer = class Timer {
|
||||
|
||||
@@ -19,12 +19,17 @@ const SandboxedModule = require('sandboxed-module')
|
||||
describe('ProjectManager - flushProject', function () {
|
||||
beforeEach(function () {
|
||||
let Timer
|
||||
this.LockManager = {
|
||||
getLock: sinon.stub().yields(),
|
||||
releaseLock: sinon.stub().yields(),
|
||||
}
|
||||
this.ProjectManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
'./RedisManager': (this.RedisManager = {}),
|
||||
'./ProjectHistoryRedisManager': (this.ProjectHistoryRedisManager = {}),
|
||||
'./DocumentManager': (this.DocumentManager = {}),
|
||||
'./HistoryManager': (this.HistoryManager = {}),
|
||||
'./LockManager': this.LockManager,
|
||||
'./Metrics': (this.Metrics = {
|
||||
Timer: (Timer = (function () {
|
||||
Timer = class Timer {
|
||||
|
||||
@@ -18,12 +18,17 @@ const Errors = require('../../../../app/js/Errors.js')
|
||||
describe('ProjectManager - getProjectDocsAndFlushIfOld', function () {
|
||||
beforeEach(function () {
|
||||
let Timer
|
||||
this.LockManager = {
|
||||
getLock: sinon.stub().yields(),
|
||||
releaseLock: sinon.stub().yields(),
|
||||
}
|
||||
this.ProjectManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
'./RedisManager': (this.RedisManager = {}),
|
||||
'./ProjectHistoryRedisManager': (this.ProjectHistoryRedisManager = {}),
|
||||
'./DocumentManager': (this.DocumentManager = {}),
|
||||
'./HistoryManager': (this.HistoryManager = {}),
|
||||
'./LockManager': this.LockManager,
|
||||
'./Metrics': (this.Metrics = {
|
||||
Timer: (Timer = (function () {
|
||||
Timer = class Timer {
|
||||
|
||||
@@ -17,6 +17,10 @@ describe('ProjectManager', function () {
|
||||
flushProjectChangesAsync: sinon.stub(),
|
||||
shouldFlushHistoryOps: sinon.stub().returns(false),
|
||||
}
|
||||
this.LockManager = {
|
||||
getLock: sinon.stub().yields(),
|
||||
releaseLock: sinon.stub().yields(),
|
||||
}
|
||||
this.Metrics = {
|
||||
Timer: class Timer {},
|
||||
}
|
||||
@@ -28,6 +32,7 @@ describe('ProjectManager', function () {
|
||||
'./ProjectHistoryRedisManager': this.ProjectHistoryRedisManager,
|
||||
'./DocumentManager': this.DocumentManager,
|
||||
'./HistoryManager': this.HistoryManager,
|
||||
'./LockManager': this.LockManager,
|
||||
'./Metrics': this.Metrics,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user