[MM-23412] : Migrate "components/file_preview_modal/image_preview.test.jsx" to Typescript (#23670)
Этот коммит содержится в:
@@ -5,13 +5,13 @@ import React from 'react';
|
|||||||
import {shallow} from 'enzyme';
|
import {shallow} from 'enzyme';
|
||||||
|
|
||||||
import ImagePreview from 'components/file_preview_modal/image_preview';
|
import ImagePreview from 'components/file_preview_modal/image_preview';
|
||||||
|
import {TestHelper} from 'utils/test_helper';
|
||||||
|
|
||||||
describe('components/view_image/ImagePreview', () => {
|
describe('components/view_image/ImagePreview', () => {
|
||||||
|
const fileInfo1 = TestHelper.getFileInfoMock({id: 'file_id', extension: 'm4a', has_preview_image: false});
|
||||||
const baseProps = {
|
const baseProps = {
|
||||||
canDownloadFiles: true,
|
canDownloadFiles: true,
|
||||||
fileInfo: {
|
fileInfo: fileInfo1,
|
||||||
id: 'file_id',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
test('should match snapshot, without preview', () => {
|
test('should match snapshot, without preview', () => {
|
||||||
@@ -26,6 +26,7 @@ describe('components/view_image/ImagePreview', () => {
|
|||||||
const props = {
|
const props = {
|
||||||
...baseProps,
|
...baseProps,
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
|
...fileInfo1,
|
||||||
id: 'file_id_1',
|
id: 'file_id_1',
|
||||||
has_preview_image: true,
|
has_preview_image: true,
|
||||||
},
|
},
|
||||||
@@ -56,6 +57,7 @@ describe('components/view_image/ImagePreview', () => {
|
|||||||
...baseProps,
|
...baseProps,
|
||||||
canDownloadFiles: false,
|
canDownloadFiles: false,
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
|
...fileInfo1,
|
||||||
id: 'file_id_1',
|
id: 'file_id_1',
|
||||||
has_preview_image: true,
|
has_preview_image: true,
|
||||||
},
|
},
|
||||||
@@ -69,10 +71,13 @@ describe('components/view_image/ImagePreview', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should not download link for external file', () => {
|
test('should not download link for external file', () => {
|
||||||
|
fileInfo1.link = 'https://example.com/image.png';
|
||||||
const props = {
|
const props = {
|
||||||
...baseProps,
|
...baseProps,
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
|
...fileInfo1,
|
||||||
link: 'https://example.com/image.png',
|
link: 'https://example.com/image.png',
|
||||||
|
id: '',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Ссылка в новой задаче
Block a user