Merge pull request #9563 from overleaf/em-tpds-merge-metadata

Return metadata from TPDS update endpoint in web

GitOrigin-RevId: 9154be67f7f975807c6e986a5d6fb66013c9a384
This commit is contained in:
Eric Mc Sween
2022-09-12 15:59:16 +01:00
committed by Copybot
parent ceb000eb2b
commit 19c73cbd73
13 changed files with 236 additions and 200 deletions

View File

@@ -77,6 +77,7 @@ describe('ProjectEntityMongoUpdateHandler', function () {
getAllEntitiesFromProject: sinon.stub(),
}
this.ProjectLocator = {
findElementByMongoPath: sinon.stub().throws(new Error('not found')),
promises: {
findElement: sinon.stub().rejects(new Error('not found')),
findElementByPath: sinon.stub().rejects(new Error('not found')),
@@ -388,6 +389,9 @@ describe('ProjectEntityMongoUpdateHandler', function () {
)
.chain('exec')
.resolves(this.project)
this.ProjectLocator.findElementByMongoPath
.withArgs(this.project, 'rootFolder.0.fileRefs.0')
.returns(newFile)
await this.subject.promises.replaceFileWithNew(
this.project._id,
this.file._id,