-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathteam_sidebar.test.tsx
More file actions
80 lines (71 loc) · 2.2 KB
/
team_sidebar.test.tsx
File metadata and controls
80 lines (71 loc) · 2.2 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import {describe, expect, test} from '@jest/globals';
import {render} from '@testing-library/react';
import {configureStore, createSlice} from '@reduxjs/toolkit';
import {Provider} from 'react-redux';
import TeamSidebar from './team_sidebar';
const mockTheme = {
sidebarBg: '#ffffff',
sidebarText: '#333333',
sidebarUnreadText: '#ff0000',
sidebarTextHoverBg: '#eeeeee',
sidebarTextActiveBorder: '#007bff',
sidebarTextActiveColor: '#007bff',
sidebarHeaderBg: '#f8f9fa',
sidebarHeaderTextColor: '#495057',
onlineIndicator: '#28a745',
awayIndicator: '#ffc107',
dndIndicator: '#dc3545',
mentionBg: '#ffeb3b',
mentionBj: '#ffeb3b',
mentionColor: '#333333',
centerChannelBg: '#f8f9fa',
centerChannelColor: '#333333',
newMessageSeparator: '#007bff',
linkColor: '#007bff',
buttonBg: '#007bff',
buttonColor: '#ffffff',
errorTextColor: '#dc3545',
mentionHighlightBg: '#ffeb3b',
mentionHighlightLink: '#007bff',
codeTheme: 'solarized-dark',
};
const mockSlice = createSlice({
name: 'mock-reducer',
initialState: {
'plugins-com.github.manland.mattermost-plugin-gitlab': {
connected: true,
username: 'mattermost',
clientId: '',
lhsData: {
reviews: [],
yourAssignedPrs: [],
yourAssignedIssues: [],
todos: [],
},
gitlabURL: 'https://gitlab.com/gitlab-org',
organization: '',
rhsPluginAction: () => true,
},
entities: {general: {config: {}}},
},
reducers: {},
});
const mockStore = configureStore({
reducer: mockSlice.reducer,
});
describe('TeamSidebar', () => {
test.each([true, false])('should render when show is %s', (show) => {
const {container} = render(
<Provider store={mockStore}>
<TeamSidebar
show={show}
theme={mockTheme}
/>
</Provider>,
);
expect(container).toMatchSnapshot();
});
});