2021-05-21 07:32:51 -04:00
|
|
|
import { screen } from '@testing-library/react'
|
2021-04-28 07:41:20 -04:00
|
|
|
|
2021-05-21 07:32:51 -04:00
|
|
|
import { renderWithEditorContext } from '../../../helpers/render-with-context'
|
2021-06-10 07:26:04 -04:00
|
|
|
import FileViewImage from '../../../../../frontend/js/features/file-view/components/file-view-image.js'
|
2021-04-28 07:41:20 -04:00
|
|
|
|
2021-06-10 07:26:04 -04:00
|
|
|
describe('<FileViewImage />', function () {
|
2021-04-28 07:41:20 -04:00
|
|
|
const file = {
|
|
|
|
id: '60097ca20454610027c442a8',
|
|
|
|
name: 'file.jpg',
|
|
|
|
linkedFileData: {
|
|
|
|
source_entity_path: '/source-entity-path',
|
|
|
|
provider: 'project_file',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
it('renders an image', function () {
|
2021-05-21 07:32:51 -04:00
|
|
|
renderWithEditorContext(
|
2021-06-10 07:26:04 -04:00
|
|
|
<FileViewImage
|
2021-04-28 07:41:20 -04:00
|
|
|
fileName={file.name}
|
|
|
|
fileId={file.id}
|
|
|
|
onError={() => {}}
|
|
|
|
onLoad={() => {}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
screen.getByRole('img')
|
|
|
|
})
|
|
|
|
})
|