You've already forked mattermost-webapp
mirror of
https://github.com/zerotier/mattermost-webapp.git
synced 2026-05-22 16:23:25 -07:00
84adb4e5a5
* merge changes from MM-14748 * Allow to invalidate email invites (#2541) * style issues, some missed settings * Delete commented line * update snapshots, tests * fix i18n strings, camelCasing, naming * also update snapshots * fix loading integrations in sidebar * Title edits per feedback * Hide settings if RestrictSystemAdmin enabled * refactor some logic for rendering menus * content edits * update snapshots, unit tests * Page name “Compliance Settings” to “Compliance” * Fix routing issues * redirects to default route none defined * redirects to default if route is hidden in LHS * update tests/snapshots * buildEnterpriseReady in router * GIF (Beta) for page name; rebase * Update snapshot * fix Gif title string in translation file * refactor admin routes w/ reduce/filter * Re-organize system console sections * Fix some i18n IDs & strings
65 lines
1.7 KiB
React
65 lines
1.7 KiB
React
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
import {shallow} from 'enzyme';
|
|
|
|
import AdminConsole from 'components/admin_console/admin_console';
|
|
|
|
describe('components/AdminConsole', () => {
|
|
const baseProps = {
|
|
config: {
|
|
TestField: true,
|
|
ExperimentalSettings: {
|
|
RestrictSystemAdmin: false,
|
|
},
|
|
},
|
|
license: {},
|
|
buildEnterpriseReady: true,
|
|
match: {
|
|
url: '',
|
|
},
|
|
roles: {
|
|
channel_admin: 'test',
|
|
channel_user: 'test',
|
|
team_admin: 'test',
|
|
team_user: 'test',
|
|
system_admin: 'test',
|
|
system_user: 'test',
|
|
},
|
|
showNavigationPrompt: false,
|
|
isCurrentUserSystemAdmin: false,
|
|
actions: {
|
|
getConfig: jest.fn(),
|
|
getEnvironmentConfig: jest.fn(),
|
|
setNavigationBlocked: jest.fn(),
|
|
confirmNavigation: jest.fn(),
|
|
cancelNavigation: jest.fn(),
|
|
loadRolesIfNeeded: jest.fn(),
|
|
editRole: jest.fn(),
|
|
},
|
|
};
|
|
|
|
test('should redirect to / when not system admin', () => {
|
|
const props = {
|
|
...baseProps,
|
|
isCurrentUserSystemAdmin: false,
|
|
};
|
|
const wrapper = shallow(
|
|
<AdminConsole {...props}/>
|
|
);
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
test('should generate the routes', () => {
|
|
const props = {
|
|
...baseProps,
|
|
isCurrentUserSystemAdmin: true,
|
|
};
|
|
const wrapper = shallow(
|
|
<AdminConsole {...props}/>
|
|
);
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|