mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
[web] restore downloading from history-v1 via legacy file endpoint (#23450)
GitOrigin-RevId: f6d12cfe445c7c41a62a563c9a5e7089bf94344f
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user