* update snapshots to only compare against the elements and not the bloated objects * resolve conflicts to master
43 lines
1.3 KiB
JavaScript
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();
|
|
});
|
|
});
|