Files
mattermost-mobile/app/components/threads_button/threads_button.test.tsx
Anurag Shivarathri 5dd3121bbc [Gekidou MM-43527] Add threads item to the channel switcher (#6657)
* Threads item in channel switcher

* Misc

* Updated test & renamed type

* Reverted unwanted changes

* Changed thread text to i18n

* feedback fix

* Merge conflict steps

* Merge fix

* test fix

* Added onPress to the dependencies

* Moved the term matching logic to the useMemo block

* Misc

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-25 18:51:04 +05:30

62 lines
1.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {renderWithIntlAndTheme} from '@test/intl-test-helper';
import Threads from './threads_button';
const baseProps = {
currentChannelId: 'someChannelId',
groupUnreadsSeparately: true,
onlyUnreads: false,
unreadsAndMentions: {
unreads: false,
mentions: 0,
},
};
describe('Thread item in the channel list', () => {
test('Threads Component should match snapshot', () => {
const {toJSON} = renderWithIntlAndTheme(
<Threads {...baseProps}/>,
);
expect(toJSON()).toMatchSnapshot();
});
test('Threads Component should match snapshot with only unreads filter', () => {
const {toJSON} = renderWithIntlAndTheme(
<Threads
{...baseProps}
onlyUnreads={true}
/>,
);
expect(toJSON()).toMatchSnapshot();
});
test('Threads Component should match snapshot with isInfo', () => {
const {toJSON} = renderWithIntlAndTheme(
<Threads
{...baseProps}
isInfo={true}
/>,
);
expect(toJSON()).toMatchSnapshot();
});
test('Threads Component should match snapshot, groupUnreadsSeparately false, always show', () => {
const {toJSON} = renderWithIntlAndTheme(
<Threads
{...baseProps}
groupUnreadsSeparately={false}
onlyUnreads={true}
/>,
);
expect(toJSON()).toMatchSnapshot();
});
});