mattermost-mobile/app/screens/options_modal/options_modal_list.test.js
Daniel Espino García 4c8594d330
Add linter rules for import order and type member delimiters (#5514)
* Add linter rules for import order and type member delimiters

* Remove unneeded group

* Group all app/* imports before the internal imports

* Move app/ imports before parent imports

* Separate @node_modules imports into a different group

* Substitute app paths by aliases

* Fix @node_modules import order and add test related modules

* Add aliases for types and test, and group import types
2021-07-23 11:06:04 +02:00

43 lines
1.3 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import React from 'react';
import OptionModalListAndroid from './options_modal_list.android';
import OptionModalListIOS from './options_modal_list.ios';
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();
});
});