forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
file_info_preview.test.tsx
33 lines (27 loc) · 1.12 KB
/
file_info_preview.test.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {shallow} from 'enzyme';
import FileInfoPreview from 'components/file_info_preview/file_info_preview';
describe('components/FileInfoPreview', () => {
test('should match snapshot, can download files', () => {
const wrapper = shallow(
<FileInfoPreview
fileUrl='https://pre-release.mattermost.com/api/v4/files/rqir81f7a7ft8m6j6ej7g1txuo'
fileInfo={{name: 'Test Image', size: 100, extension: 'jpg'}}
canDownloadFiles={true}
/>
);
expect(wrapper).toMatchSnapshot();
});
test('should match snapshot, cannot download files', () => {
const wrapper = shallow(
<FileInfoPreview
fileUrl='https://pre-release.mattermost.com/api/v4/files/aasf9afshaskj1asf91jasf0a0'
fileInfo={{name: 'Test Image 2', size: 200, extension: 'png'}}
canDownloadFiles={false}
/>
);
expect(wrapper).toMatchSnapshot();
});
});