* showing unread and threads, of group unread setting in on
* using third variable to maintain state for showing categories
* removed useState from useMemo
* Removed state, return orderctegroies if onlyUnreads & unreadsOnTop is true
* test cases updates
* removed onlyUnreads props from threads
* removed onlyUnreads
* test cases updated
* removed unnecessary changes
* removed onlyUnreads from dep
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
(cherry picked from commit 6dcefaf1e4)
Co-authored-by: Aditya Pratap Singh Hada <49001649+apshada@users.noreply.github.com>
36 lines
946 B
TypeScript
36 lines
946 B
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',
|
|
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 onCenterBg', () => {
|
|
const {toJSON} = renderWithIntlAndTheme(
|
|
<Threads
|
|
{...baseProps}
|
|
onCenterBg={true}
|
|
/>,
|
|
);
|
|
|
|
expect(toJSON()).toMatchSnapshot();
|
|
});
|
|
});
|