[web] restore downloading from history-v1 via legacy file endpoint (#23450)

GitOrigin-RevId: f6d12cfe445c7c41a62a563c9a5e7089bf94344f
This commit is contained in:
Jakob Ackermann
2025-02-07 09:06:52 +00:00
committed by Copybot
parent 1aec79d726
commit b0534b7f85
4 changed files with 132 additions and 45 deletions
@@ -9,6 +9,7 @@ const MODULE_PATH =
const expectedFileHeaders = {
'Cache-Control': 'private, max-age=3600',
'X-Served-By': 'filestore',
}
describe('FileStoreController', function () {
@@ -56,7 +57,7 @@ describe('FileStoreController', function () {
describe('getFile', function () {
beforeEach(function () {
this.FileStoreHandler.promises.getFileStream.resolves(this.stream)
this.ProjectLocator.promises.findElement.resolves(this.file)
this.ProjectLocator.promises.findElement.resolves({ element: this.file })
})
it('should call the file store handler with the project_id file_id and any query string', async function () {
@@ -193,6 +194,10 @@ describe('FileStoreController', function () {
})
describe('getFileHead', function () {
beforeEach(function () {
this.ProjectLocator.promises.findElement.resolves({ element: this.file })
})
it('reports the file size', function (done) {
const expectedFileSize = 99393
this.FileStoreHandler.promises.getFileSize.rejects(
@@ -139,6 +139,14 @@ class MockResponse {
this.header(header, value)
}
appendHeader(header, value) {
if (this.headers[header]) {
this.headers[header] += `, ${value}`
} else {
this.headers[header] = value
}
}
setTimeout(timout) {
this.timout = timout
}