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

View File

@@ -96,7 +96,7 @@ describe('ProjectEntityUpdateHandler', function() {
)
}
this.ProjectModel = {
updateOne: sinon.stub()
update: sinon.stub()
}
this.ProjectGetter = {
getProject: sinon.stub(),
@@ -385,7 +385,7 @@ describe('ProjectEntityUpdateHandler', function() {
this.rootDocId = 'root-doc-id-123123'
})
it('should call Project.updateOne when the doc exists and has a valid extension', function() {
it('should call Project.update when the doc exists and has a valid extension', function() {
this.ProjectEntityHandler.getDocPathByProjectIdAndDocId.yields(
null,
`/main.tex`
@@ -396,12 +396,12 @@ describe('ProjectEntityUpdateHandler', function() {
this.rootDocId,
() => {}
)
this.ProjectModel.updateOne
this.ProjectModel.update
.calledWith({ _id: projectId }, { rootDoc_id: this.rootDocId })
.should.equal(true)
})
it("should not call Project.updateOne when the doc doesn't exist", function() {
it("should not call Project.update when the doc doesn't exist", function() {
this.ProjectEntityHandler.getDocPathByProjectIdAndDocId.yields(
Errors.NotFoundError
)
@@ -411,7 +411,7 @@ describe('ProjectEntityUpdateHandler', function() {
this.rootDocId,
() => {}
)
this.ProjectModel.updateOne
this.ProjectModel.update
.calledWith({ _id: projectId }, { rootDoc_id: this.rootDocId })
.should.equal(false)
})
@@ -434,9 +434,9 @@ describe('ProjectEntityUpdateHandler', function() {
})
describe('unsetRootDoc', function() {
it('should call Project.updateOne', function() {
it('should call Project.update', function() {
this.ProjectEntityUpdateHandler.unsetRootDoc(projectId)
this.ProjectModel.updateOne
this.ProjectModel.update
.calledWith({ _id: projectId }, { $unset: { rootDoc_id: true } })
.should.equal(true)
})