Merge pull request #3277 from overleaf/revert-3257-jpa-mongoose-latest

Revert "[misc] upgrade mongoose to the latest version"

GitOrigin-RevId: d5957fca68be65a08a687476742ffbb9c3cb86e8
This commit is contained in:
Simon Detheridge
2020-10-12 13:35:50 +01:00
committed by Copybot
parent dba5127856
commit c257b9695a
59 changed files with 655 additions and 445 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)
})