Files
mattermost-mobile/app/components/file_attachment_list/file_attachment.test.js
Elias Nahum 0c42c0d976 Deps update (#3806)
* Dependecy updates

* Update dependencies
2020-01-20 13:22:07 -03:00

46 lines
1.2 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {shallow} from 'enzyme';
import FileAttachment from './file_attachment.js';
import Preferences from 'mattermost-redux/constants/preferences';
jest.mock('react-native-doc-viewer', () => ({
openDoc: jest.fn(),
}));
describe('FileAttachment', () => {
const baseProps = {
canDownloadFiles: true,
file: {
create_at: 1546893090093,
delete_at: 0,
extension: 'png',
has_preview_image: true,
height: 171,
id: 'fileId',
name: 'image.png',
post_id: 'postId',
size: 14894,
update_at: 1546893090093,
user_id: 'userId',
width: 425,
data: {
mime_type: 'image/png',
},
},
id: 'id',
index: 0,
theme: Preferences.THEMES.default,
};
test('should match snapshot', () => {
const wrapper = shallow(
<FileAttachment {...baseProps}/>,
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});