file-view-image.test.js 714 B

123456789101112131415161718192021222324252627
  1. import { screen } from '@testing-library/react'
  2. import { renderWithEditorContext } from '../../../helpers/render-with-context'
  3. import FileViewImage from '../../../../../frontend/js/features/file-view/components/file-view-image.js'
  4. describe('<FileViewImage />', function () {
  5. const file = {
  6. id: '60097ca20454610027c442a8',
  7. name: 'file.jpg',
  8. linkedFileData: {
  9. source_entity_path: '/source-entity-path',
  10. provider: 'project_file',
  11. },
  12. }
  13. it('renders an image', function () {
  14. renderWithEditorContext(
  15. <FileViewImage
  16. fileName={file.name}
  17. fileId={file.id}
  18. onError={() => {}}
  19. onLoad={() => {}}
  20. />
  21. )
  22. screen.getByRole('img')
  23. })
  24. })