mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-20 03:12:48 +00:00
Merge pull request #2648 from overleaf/msm-fix-multiresult-promisify
Added multiResult to ProjectEntityHandler.promises.getDoc GitOrigin-RevId: 6a2807cdae822c188298b48887d0eff57edf12d4
This commit is contained in:
parent
6734d9e107
commit
403704710c
1 changed files with 32 additions and 0 deletions
|
@ -331,4 +331,36 @@ describe('ProjectEntityHandler', function() {
|
|||
.should.equal(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('promises.getDoc', function() {
|
||||
let result
|
||||
|
||||
beforeEach(async function() {
|
||||
this.lines = ['mock', 'doc', 'lines']
|
||||
this.rev = 5
|
||||
this.version = 42
|
||||
this.ranges = { mock: 'ranges' }
|
||||
|
||||
this.DocstoreManager.getDoc = sinon
|
||||
.stub()
|
||||
.callsArgWith(3, null, this.lines, this.rev, this.version, this.ranges)
|
||||
result = await this.ProjectEntityHandler.promises.getDoc(
|
||||
project_id,
|
||||
doc_id
|
||||
)
|
||||
})
|
||||
|
||||
it('should call the docstore', function() {
|
||||
this.DocstoreManager.getDoc
|
||||
.calledWith(project_id, doc_id)
|
||||
.should.equal(true)
|
||||
})
|
||||
|
||||
it('should return the lines, rev, version and ranges', function() {
|
||||
expect(result.lines).to.equal(this.lines)
|
||||
expect(result.rev).to.equal(this.rev)
|
||||
expect(result.version).to.equal(this.version)
|
||||
expect(result.ranges).to.equal(this.ranges)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue