binary-file-image.test.js 750 B

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