mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-27 02:51:57 +02:00
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:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user