Files
mattermost-mobile/app/components/threads_button/threads_button.test.tsx
Daniel Espino García a8ee3a1b5a Fix and unify channel and user list items (#7175)
* Fix channel and user list items

* Fixes on members and create a dm lists

* Fix tutorial and ipad

* Fix test

* Address feedback

* Several fixes on Android

* Fix tests

* Address feedback

* Add more non breaking strings

---------

Co-authored-by: Daniel Espino <danielespino@MacBook-Pro-de-Daniel.local>
2023-04-19 10:13:14 +02:00

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 onCenterBg', () => {
const {toJSON} = renderWithIntlAndTheme(
<Threads
{...baseProps}
onCenterBg={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();
});
});