mattermost-mobile/app/screens/options_modal/options_modal_list.test.js
Elias Nahum dcaaaee44c
MM-30164 fix safe area insets (#4979)
* MM-30164 fix safe area insets

* Fix unit test setup mock for react-native-device-info

* Add insets for edit profile screen

* Fix about screen

* Fix theme screen

* Lock phone screen to portrait

* fix unit tests

* Fix autocomplete layout
2020-11-23 20:10:09 -03: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();
});
});