mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #12831 from overleaf/jpa-project-history-pipe
[project-history] migrate to fetch/stream.pipeline GitOrigin-RevId: 9224eab6a0ad9cbb0c80e443a1c0d4abdd9bbd0f
This commit is contained in:
@@ -52,8 +52,10 @@ describe('HttpController', function () {
|
||||
this.RetryManager = {}
|
||||
this.FlushManager = {}
|
||||
this.request = {}
|
||||
this.pipeline = sinon.stub()
|
||||
this.HttpController = await esmock(MODULE_PATH, {
|
||||
request: this.request,
|
||||
stream: { pipeline: this.pipeline },
|
||||
'../../../../app/js/UpdatesProcessor.js': this.UpdatesProcessor,
|
||||
'../../../../app/js/SummarizedUpdatesManager.js':
|
||||
this.SummarizedUpdatesManager,
|
||||
@@ -85,7 +87,7 @@ describe('HttpController', function () {
|
||||
describe('getProjectBlob', function () {
|
||||
beforeEach(function () {
|
||||
this.blobHash = 'abcd'
|
||||
this.stream = { pipe: sinon.stub() }
|
||||
this.stream = {}
|
||||
this.HistoryStoreManager.getProjectBlobStream.yields(null, this.stream)
|
||||
this.HttpController.getProjectBlob(
|
||||
{ params: { project_id: this.projectId, hash: this.blobHash } },
|
||||
@@ -98,7 +100,7 @@ describe('HttpController', function () {
|
||||
this.HistoryStoreManager.getProjectBlobStream
|
||||
.calledWith(this.projectId, this.blobHash)
|
||||
.should.equal(true)
|
||||
this.stream.pipe.calledWith(this.res).should.equal(true)
|
||||
this.pipeline.should.have.been.calledWith(this.stream, this.res)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -308,7 +310,7 @@ describe('HttpController', function () {
|
||||
},
|
||||
}
|
||||
this.res = { mock: 'res' }
|
||||
this.stream = { pipe: sinon.stub() }
|
||||
this.stream = {}
|
||||
this.SnapshotManager.getFileSnapshotStream.yields(null, this.stream)
|
||||
this.HttpController.getFileSnapshot(this.req, this.res, this.next)
|
||||
})
|
||||
@@ -322,7 +324,7 @@ describe('HttpController', function () {
|
||||
})
|
||||
|
||||
it('should pipe the returned stream into the response', function () {
|
||||
this.stream.pipe.calledWith(this.res).should.equal(true)
|
||||
this.pipeline.should.have.been.calledWith(this.stream, this.res)
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user