mattermost-mobile/app/components/badge.test.js
Elias Nahum 7c09334dc4
Deps update (#3806)
* Dependecy updates

* Update dependencies
2020-01-20 13:20:03 -03:00

28 lines
879 B
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {Text, TouchableWithoutFeedback} from 'react-native';
import {shallow} from 'enzyme';
import Badge from './badge';
describe('Badge', () => {
const baseProps = {
count: 100,
countStyle: {color: '#145dbf', fontSize: 10},
style: {backgroundColor: '#ffffff'},
containerStyle: {borderColor: '#000000'},
onPress: jest.fn(),
};
test('should match snapshot', () => {
const wrapper = shallow(
<Badge {...baseProps}/>,
);
expect(wrapper.instance().renderText()).toMatchSnapshot();
expect(wrapper.find(TouchableWithoutFeedback).exists()).toEqual(true);
expect(wrapper.find(Text).first().props().children).toContain('99+');
});
});