overleaf/services/web/test/frontend/features/file-view/components/file-view-image.test.js
Alf Eaton 764234e42b Merge pull request #4158 from overleaf/ae-rename-file-view
Rename `binary-file` components to `file-view`

GitOrigin-RevId: b960d4e6f154ee1a5847782a1fcb1e4e61159603
2021-06-11 02:06:38 +00:00

28 lines
740 B
JavaScript

import React from 'react'
import { screen } from '@testing-library/react'
import { renderWithEditorContext } from '../../../helpers/render-with-context'
import FileViewImage from '../../../../../frontend/js/features/file-view/components/file-view-image.js'
describe('<FileViewImage />', function () {
const file = {
id: '60097ca20454610027c442a8',
name: 'file.jpg',
linkedFileData: {
source_entity_path: '/source-entity-path',
provider: 'project_file',
},
}
it('renders an image', function () {
renderWithEditorContext(
<FileViewImage
fileName={file.name}
fileId={file.id}
onError={() => {}}
onLoad={() => {}}
/>
)
screen.getByRole('img')
})
})