* MM-30286 Detox/E2E: Add e2e test for MM-T3249 and added useful helper functions * Update app/components/sidebars/main/channels_list/channels_list.js Co-authored-by: Elias Nahum <nahumhbl@gmail.com> * Add team icon content helper query * Fixed reset for teams * MM-30286 Detox/E2E: Add e2e test for MM-T3235 (#5003) * MM-30286 Detox/E2E: Add e2e test for MM-T3255 (#5006) * Fix merge issues Co-authored-by: Elias Nahum <nahumhbl@gmail.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
29 lines
904 B
JavaScript
29 lines
904 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 = {
|
|
testID: 'badge',
|
|
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+');
|
|
});
|
|
});
|