Merge pull request #2361 from overleaf/em-project-imports-2

Import full folder structure in a single Mongo update

GitOrigin-RevId: 623d2a098b2084fdd0193e1593c1c55c08a2d92d
This commit is contained in:
Eric Mc Sween
2019-11-18 09:03:04 -05:00
committed by sharelatex
parent bf9473fb41
commit 27504d7b9d
8 changed files with 810 additions and 2262 deletions

View File

@@ -453,8 +453,8 @@ describe('ProjectEntityUpdateHandler', function() {
return this.logger.warn
.calledWith(
{
project_id,
doc_id,
projectId: project_id,
docId: doc_id,
lines: this.docLines
},
'doc not found while updating doc lines'
@@ -504,7 +504,11 @@ describe('ProjectEntityUpdateHandler', function() {
.stub()
.yields(null, `/main.tex`)
this.ProjectEntityUpdateHandler.setRootDoc(project_id, this.rootDoc_id)
this.ProjectEntityUpdateHandler.setRootDoc(
project_id,
this.rootDoc_id,
() => {}
)
return this.ProjectModel.update
.calledWith({ _id: project_id }, { rootDoc_id: this.rootDoc_id })
.should.equal(true)
@@ -516,7 +520,11 @@ describe('ProjectEntityUpdateHandler', function() {
.stub()
.yields(Errors.NotFoundError)
this.ProjectEntityUpdateHandler.setRootDoc(project_id, this.rootDoc_id)
this.ProjectEntityUpdateHandler.setRootDoc(
project_id,
this.rootDoc_id,
() => {}
)
return this.ProjectModel.update
.calledWith({ _id: project_id }, { rootDoc_id: this.rootDoc_id })
.should.equal(false)