mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Merge pull request #22178 from overleaf/jpa-file-view-hash-2
[web] migrate file-view to download from history-v1 (via web) 2/2 GitOrigin-RevId: 93172cbbd2d19a55bb27f5b0ca0b494f815a3632
This commit is contained in:
@@ -151,23 +151,10 @@ describe('Path utils', function () {
|
||||
const preview = previewByPath(
|
||||
rootFolder,
|
||||
'test-project-id',
|
||||
'test-folder/example.png',
|
||||
false
|
||||
'test-folder/example.png'
|
||||
)
|
||||
expect(preview).to.deep.equal({
|
||||
url: '/project/test-project-id/file/test-file-in-folder',
|
||||
extension: 'png',
|
||||
})
|
||||
})
|
||||
it('returns handles history file-tree', function () {
|
||||
const preview = previewByPath(
|
||||
rootFolder,
|
||||
'test-project-id',
|
||||
'test-folder/example.png',
|
||||
true
|
||||
)
|
||||
expect(preview).to.deep.equal({
|
||||
url: '/project/test-project-id/blob/42',
|
||||
url: '/project/test-project-id/blob/42?fallback=test-file-in-folder',
|
||||
extension: 'png',
|
||||
})
|
||||
})
|
||||
|
||||
@@ -23,12 +23,12 @@ describe('<FileViewText/>', function () {
|
||||
})
|
||||
|
||||
it('renders a text view', async function () {
|
||||
fetchMock.head('express:/project/:project_id/file/:file_id', {
|
||||
fetchMock.head('express:/project/:project_id/blob/:hash', {
|
||||
status: 201,
|
||||
headers: { 'Content-Length': 10000 },
|
||||
})
|
||||
fetchMock.get(
|
||||
'express:/project/:project_id/file/:file_id',
|
||||
'express:/project/:project_id/blob/:hash',
|
||||
'Text file content'
|
||||
)
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@ describe('<FileView/>', function () {
|
||||
|
||||
describe('for a text file', function () {
|
||||
it('shows a loading indicator while the file is loading', async function () {
|
||||
fetchMock.head('express:/project/:project_id/file/:file_id', {
|
||||
fetchMock.head('express:/project/:project_id/blob/:hash', {
|
||||
status: 201,
|
||||
headers: { 'Content-Length': 10000 },
|
||||
})
|
||||
fetchMock.get(
|
||||
'express:/project/:project_id/file/:file_id',
|
||||
'express:/project/:project_id/blob/:hash',
|
||||
'Text file content'
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user