diff --git a/packages/cozy-viewer/src/ViewersByFile/ImageViewer.spec.jsx b/packages/cozy-viewer/src/ViewersByFile/ImageViewer.spec.jsx
deleted file mode 100644
index a333dcdeda..0000000000
--- a/packages/cozy-viewer/src/ViewersByFile/ImageViewer.spec.jsx
+++ /dev/null
@@ -1,73 +0,0 @@
-import { render, waitFor } from '@testing-library/react'
-import React from 'react'
-
-import { checkImageSource } from 'cozy-ui/transpiled/react/FileImageLoader/checkImageSource'
-import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
-import EncryptedProvider from 'cozy-ui/transpiled/react/providers/Encrypted'
-
-import ImageViewer from './ImageViewer'
-import DemoProvider from '../providers/DemoProvider'
-
-jest.mock('cozy-ui/transpiled/react/FileImageLoader/checkImageSource', () => ({
- ...jest.requireActual(
- 'cozy-ui/transpiled/react/FileImageLoader/checkImageSource'
- ),
- checkImageSource: jest.fn()
-}))
-
-const file = {
- _id: 'image',
- class: 'image',
- mime: 'image/jpg',
- name: 'sample.jpg',
- links: {
- large: 'https://viewerdemo.cozycloud.cc/IMG_0062.PNG'
- }
-}
-
-const gestures = {
- on: jest.fn(),
- off: jest.fn(),
- get: jest.fn()
-}
-
-const setup = () => {
- const root = render(
-
-
-
-
-
-
-
- )
-
- return { root }
-}
-
-describe('ImageViewer', () => {
- afterEach(() => {
- jest.restoreAllMocks
- })
-
- it('should render a spinner then the image viewer', async () => {
- const { root } = setup()
- const { container, queryByRole } = root
-
- expect(queryByRole('progressbar')).toBeTruthy()
-
- // simulate a successfull image loading
- checkImageSource.mockResolvedValue('ok')
-
- await waitFor(() => container.querySelector('img'))
-
- const img = container.querySelector('img')
- expect(img.getAttribute('alt')).toBe(file.name)
- expect(img.getAttribute('src')).toBe(file.links.large)
- })
-})
diff --git a/packages/cozy-viewer/src/ViewersByFile/PdfMobileViewer.spec.jsx b/packages/cozy-viewer/src/ViewersByFile/PdfMobileViewer.spec.jsx
deleted file mode 100644
index 97eb3b8422..0000000000
--- a/packages/cozy-viewer/src/ViewersByFile/PdfMobileViewer.spec.jsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import { render, waitFor } from '@testing-library/react'
-import React from 'react'
-
-import { CozyProvider, createMockClient } from 'cozy-client'
-import logger from 'cozy-logger'
-import EncryptedProvider from 'cozy-ui/transpiled/react/providers/Encrypted'
-import { I18n } from 'cozy-ui/transpiled/react/providers/I18n'
-
-import { PdfMobileViewer } from './PdfMobileViewer'
-
-logger.error = logger.warn = jest.fn()
-
-const client = createMockClient({})
-client.collection = jest.fn(() => ({
- getDownloadLinkById: jest.fn()
-}))
-client.plugins.realtime = {
- subscribe: jest.fn(),
- unsubscribe: jest.fn(),
- unsubscribeAll: jest.fn()
-}
-jest.mock('cozy-ui/transpiled/react/providers/Alert', () => ({
- useAlert: jest.fn().mockReturnValue({ showAlert: jest.fn() })
-}))
-
-const file = {
- _id: 'pdf',
- class: 'pdf',
- name: 'Demo.pdf',
- mime: 'application/pdf',
- links: {
- medium: 'https://viewerdemo.cozycloud.cc/IMG_0062.PNG'
- }
-}
-
-const setup = ({ file }) => {
- const root = render(
-
- ''}>
-
- x} />
-
-
-
- )
-
- return { root }
-}
-
-describe('PdfMobileViewer', () => {
- it('should show a spinner if image is not loaded', () => {
- const { root } = setup({ file })
- const { getByRole } = root
-
- expect(getByRole('progressbar'))
- })
-
- describe('errors if file as no medium or failed to download', () => {
- let fileWithoutLinks = file
-
- beforeAll(() => {
- fileWithoutLinks.links = undefined
- })
-
- it('should show "download" button on browser', async () => {
- const { root } = setup({ file: fileWithoutLinks })
- const { getByText, queryByRole } = root
-
- await waitFor(() => {
- expect(queryByRole('progressbar')).toBeFalsy()
- expect(getByText('Viewer.download'))
- expect(getByText(file.name))
- })
- })
- })
-})