file-view-refresh-error.test.tsx 879 B

123456789101112131415161718192021222324252627282930
  1. import { render, screen } from '@testing-library/react'
  2. import FileViewRefreshError from '@/features/file-view/components/file-view-refresh-error'
  3. import type { BinaryFile } from '@/features/file-view/types/binary-file'
  4. describe('<FileViewRefreshError />', function () {
  5. it('shows correct error message', function () {
  6. const anotherProjectFile: BinaryFile<'project_file'> = {
  7. id: '123abc',
  8. _id: '123abc',
  9. linkedFileData: {
  10. provider: 'project_file',
  11. source_project_id: 'some-id',
  12. source_entity_path: '/path/',
  13. },
  14. created: new Date(2023, 1, 17, 3, 24),
  15. name: 'frog.jpg',
  16. type: 'file',
  17. selected: true,
  18. }
  19. render(
  20. <FileViewRefreshError
  21. file={anotherProjectFile}
  22. refreshError="An error message"
  23. />
  24. )
  25. screen.getByText('Access Denied: An error message')
  26. })
  27. })