mattermost-mobile/app/screens/search/modifier.test.js
Elias Nahum aaa571db32
Upgrade to RN 0.62.2 (#4093)
* Upgrade to RN 0.62.0

* Update packager module paths

* Fix Android PasteableInput

* Fix regression on Android share extension credentials needed

* Update android/app/src/main/java/com/mattermost/rnbeta/RNPasteableEditTextOnPasteListener.java

* Reject commit if TSC check fails and Fix small eslint issues automatically

* Use super.getExportedCustomBubblingEventTypeConstants in RNPasteableTextInputManager

* Update to rn 0.62.2

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
2020-04-14 16:39:51 -04:00

34 lines
1,000 B
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 Preferences from '@mm-redux/constants/preferences';
import Modifier from './modifier';
describe('Search RecentItem', () => {
const item = {
value: 'in:',
modifier: 'channel-name',
description: 'to find posts in specific channels',
};
const baseProps = {
item,
setModifierValue: jest.fn(),
theme: Preferences.THEMES.default,
};
test('should match snapshot and respond to events', () => {
const wrapper = shallow(
<Modifier {...baseProps}/>,
);
expect(wrapper.getElement()).toMatchSnapshot();
wrapper.find('ForwardRef').first().props().onPress();
expect(baseProps.setModifierValue).toHaveBeenCalledTimes(1);
expect(baseProps.setModifierValue).toHaveBeenCalledWith(item.value);
});
});