Merge pull request #3348 from overleaf/revert-3298-jpa-re-land-mongoose-latest

Revert "[misc] re-land: remove mongojs and bump mongoose"

GitOrigin-RevId: 45a284435c88898d96769ab258651fb8d6d20ff5
This commit is contained in:
Jakob Ackermann
2020-11-02 15:57:41 +01:00
committed by Copybot
parent 6a837ce457
commit e249a2e5be
60 changed files with 671 additions and 454 deletions
@@ -83,9 +83,7 @@ describe('ProjectHistoryHandler', function() {
.stub()
.withArgs(project_id)
.callsArgWith(1, null, this.project)
this.ProjectModel.updateOne = sinon
.stub()
.callsArgWith(2, null, { n: 1 })
this.ProjectModel.update = sinon.stub().callsArgWith(2, null, { n: 1 })
return this.ProjectHistoryHandler.ensureHistoryExistsForProject(
project_id,
this.callback
@@ -103,7 +101,7 @@ describe('ProjectHistoryHandler', function() {
})
it('should set the new history id on the project', function() {
return this.ProjectModel.updateOne
return this.ProjectModel.update
.calledWith(
{ _id: project_id, 'overleaf.history.id': { $exists: false } },
{ 'overleaf.history.id': this.newHistoryId }
@@ -135,7 +133,7 @@ describe('ProjectHistoryHandler', function() {
.stub()
.withArgs(project_id)
.callsArgWith(1, null, this.project)
this.ProjectModel.updateOne = sinon.stub()
this.ProjectModel.update = sinon.stub()
return this.ProjectHistoryHandler.ensureHistoryExistsForProject(
project_id,
this.callback
@@ -153,7 +151,7 @@ describe('ProjectHistoryHandler', function() {
})
it('should not set the new history id on the project', function() {
return this.ProjectModel.updateOne.called.should.equal(false)
return this.ProjectModel.update.called.should.equal(false)
})
it('should not resync the project history', function() {