forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
channel_details.test.jsx
53 lines (49 loc) · 1.64 KB
/
channel_details.test.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {shallow} from 'enzyme';
import ChannelDetails from './channel_details.jsx';
describe('admin_console/team_channel_settings/channel/ChannelDetails', () => {
test('should match snapshot', () => {
const groups = [{
id: '123',
display_name: 'DN',
member_count: 3,
}];
const allGroups = {
123: groups[0],
};
const testChannel = {
id: '123',
team_name: 'team',
type: 'O',
group_constrained: false,
name: 'DN',
};
const team = {
display_name: 'test',
};
const wrapper = shallow(
<ChannelDetails
groups={groups}
team={team}
totalGroups={groups.length}
actions={{
getChannel: jest.fn().mockResolvedValue([]),
convertChannelToPrivate: jest.fn(),
linkGroupSyncable: jest.fn(),
conver: jest.fn(),
patchChannel: jest.fn(),
setNavigationBlocked: jest.fn(),
unlinkGroupSyncable: jest.fn(),
getGroups: jest.fn().mockResolvedValue([]),
membersMinusGroupMembers: jest.fn(),
}}
channel={testChannel}
channelID={testChannel.id}
allGroups={allGroups}
/>
);
expect(wrapper).toMatchSnapshot();
});
});