mattermost-mobile/app/components/badge.test.js
Elias Nahum 19e6b2a00e
[MM-18362] Sidebar improvements (#3223)
* sidebar lists displays past bottom safe area insets

* Sidebar animation speed

* Sidebar improvements

* Add status icons and avatars to mattermost font

* Bot icon the same size as other channel icons

* improvements to the channel badge

* Badge color and border

* More precision when showing more unread above

* Improve GM icon

* Fix badge on team sidebar

* Align channel sidebar badges

* alignments

* Fix tests

* Remove unnecessary isLandscape in main sidebar connector
2019-09-16 13:17:48 -03:00

28 lines
878 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+');
});
});