mattermost-mobile/app/screens/options_modal/options_modal_list.test.js
2020-05-22 11:35:37 -04:00

44 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',
isLandscape: false,
};
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();
});
});