mattermost-mobile/app/screens/options_modal/option_modal_list.test.js
Saturnino Abril 63196936d0
MM-12258 Update snapshots to only compare against the elements and not the bloated objects (#2140)
* update snapshots to only compare against the elements and not the bloated objects

* resolve conflicts to master
2018-09-21 16:07:37 +08:00

43 lines
1.3 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 OptionModalListIOS from './options_modal_list.ios';
import OptionModalListAndroid from './options_modal_list.android';
describe('OptionModalList', () => {
const baseProps = {
items: [{
action: jest.fn(),
text: {
id: 'mobile.file_upload.camera',
defaultMessage: 'Take Photo or Video',
},
icon: 'camera',
}, {
action: jest.fn(),
text: {
id: 'mobile.file_upload.library',
defaultMessage: 'Photo Library',
},
icon: 'photo',
}],
onCancelPress: jest.fn(),
title: 'test',
};
test('should match snapshot for iOS', async () => {
const wrapper = shallow(
<OptionModalListIOS {...baseProps}/>,
);
expect(wrapper.getElement()).toMatchSnapshot();
});
test('should match snapshot for Android', async () => {
const wrapper = shallow(
<OptionModalListAndroid {...baseProps}/>,
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});