overleaf/services/web/test/frontend/features/file-view/components/file-view-image.test.js
Alf Eaton 7c97f8ab6e Switch to new JSX runtime (#4225)
* Use new JSX runtime and update Babel Node target
* Update .eslintrc
* Remove React imports

GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
2021-06-24 02:06:59 +00:00

27 lines
714 B
JavaScript

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')
})
})