diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/__snapshots__/team_profile.test.tsx.snap b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/__snapshots__/team_profile.test.tsx.snap
index e2ef59a76c..2596e8158b 100644
--- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/__snapshots__/team_profile.test.tsx.snap
+++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/__snapshots__/team_profile.test.tsx.snap
@@ -1,945 +1,518 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`admin_console/team_channel_settings/team/TeamProfile should match snapshot (not cloud, freemium disabled 1`] = `
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ Team Name
+
+ :
+
+
+ name
+
+
+
+
+ Team Description
+
+ :
+
+
+
+ No team description added.
+
+
+
+
+
+
+
+
+
+
+
`;
exports[`admin_console/team_channel_settings/team/TeamProfile should match snapshot with isArchived true 1`] = `
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ Team Name
+
+ :
+
+
+ name
+
+
+
+
+ Team Description
+
+ :
+
+
+
+ No team description added.
+
+
+
+
+
+
+
+
+
+
+
`;
exports[`admin_console/team_channel_settings/team/TeamProfile__Cloud restore should not be disabled when below teams limit 1`] = `
-
-
+
-
+
`;
exports[`admin_console/team_channel_settings/team/TeamProfile__Cloud should match snapshot - archived, at teams limit 1`] = `
-
-
+
-
+
`;
exports[`admin_console/team_channel_settings/team/TeamProfile__Cloud should match snapshot - not archived, at teams limit 1`] = `
-
-
+
-
+
`;
diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx
index a6d2d4310a..c4ecfafdb5 100644
--- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx
+++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx
@@ -1,12 +1,9 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
-import {shallow} from 'enzyme';
import React from 'react';
-import * as reactRedux from 'react-redux';
-import {mountWithIntl} from 'tests/helpers/intl-test-helper';
-import mockStore from 'tests/test_store';
+import {renderWithContext} from 'tests/react_testing_utils';
import {CloudProducts} from 'utils/constants';
import {FileSizes} from 'utils/file_utils';
import {TestHelper} from 'utils/test_helper';
@@ -19,6 +16,7 @@ describe('admin_console/team_channel_settings/team/TeamProfile__Cloud', () => {
onToggleArchive: jest.fn(),
isArchived: true,
};
+
const initialState = {
views: {
announcementBar: {
@@ -102,14 +100,8 @@ describe('admin_console/team_channel_settings/team/TeamProfile__Cloud', () => {
};
test('should match snapshot - archived, at teams limit', () => {
- const store = mockStore(initialState);
- const wrapper = mountWithIntl(
-
-
- ,
- );
- expect(wrapper).toMatchSnapshot();
- expect(wrapper.find('OverlayTrigger').exists()).toEqual(true);
+ const {container} = renderWithContext(, initialState);
+ expect(container).toMatchSnapshot();
});
test('should match snapshot - not archived, at teams limit', () => {
@@ -117,16 +109,9 @@ describe('admin_console/team_channel_settings/team/TeamProfile__Cloud', () => {
...baseProps,
isArchived: false,
};
- const store = mockStore(initialState);
- const wrapper = mountWithIntl(
-
-
- ,
- );
- expect(wrapper).toMatchSnapshot();
- // Unarchived will always be archiveable
- expect(wrapper.find('OverlayTrigger').exists()).toEqual(false);
+ const {container} = renderWithContext(, initialState);
+ expect(container).toMatchSnapshot();
});
test('restore should not be disabled when below teams limit', () => {
@@ -175,16 +160,9 @@ describe('admin_console/team_channel_settings/team/TeamProfile__Cloud', () => {
cardsLoaded: true,
},
};
- const store = mockStore(state);
- const wrapper = mountWithIntl(
-
-
- ,
- );
- expect(wrapper).toMatchSnapshot();
- // Unarchived will always be archiveable
- expect(wrapper.find('OverlayTrigger').exists()).toEqual(false);
+ const {container} = renderWithContext(, state);
+ expect(container).toMatchSnapshot();
});
});
@@ -194,6 +172,7 @@ describe('admin_console/team_channel_settings/team/TeamProfile', () => {
onToggleArchive: jest.fn(),
isArchived: false,
};
+
const initialState = {
views: {
announcementBar: {
@@ -274,16 +253,10 @@ describe('admin_console/team_channel_settings/team/TeamProfile', () => {
},
},
};
- const state = JSON.parse(JSON.stringify(initialState));
- const store = mockStore(state);
+
test('should match snapshot (not cloud, freemium disabled', () => {
- const wrapper = shallow(
-
-
- ,
- );
- expect(wrapper).toMatchSnapshot();
- expect(wrapper.find('OverlayTrigger').exists()).toEqual(false);
+ const {container} = renderWithContext(, initialState);
+ expect(container).toMatchSnapshot();
});
test('should match snapshot with isArchived true', () => {
@@ -291,12 +264,8 @@ describe('admin_console/team_channel_settings/team/TeamProfile', () => {
...baseProps,
isArchived: true,
};
- const wrapper = shallow(
-
-
- ,
- );
- expect(wrapper).toMatchSnapshot();
- expect(wrapper.find('OverlayTrigger').exists()).toEqual(false);
+
+ const {container} = renderWithContext(, initialState);
+ expect(container).toMatchSnapshot();
});
});
diff --git a/webapp/channels/src/components/widgets/simple_tooltip/index.ts b/webapp/channels/src/components/widgets/simple_tooltip/index.ts
deleted file mode 100644
index 2557ec70ca..0000000000
--- a/webapp/channels/src/components/widgets/simple_tooltip/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See LICENSE.txt for license information.
-
-export {
- default,
-} from './simple_tooltip';
diff --git a/webapp/channels/src/components/widgets/simple_tooltip/simple_tooltip.tsx b/webapp/channels/src/components/widgets/simple_tooltip/simple_tooltip.tsx
deleted file mode 100644
index 562e18193a..0000000000
--- a/webapp/channels/src/components/widgets/simple_tooltip/simple_tooltip.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See LICENSE.txt for license information.
-
-import React from 'react';
-import type {ReactNode, ComponentProps, CSSProperties} from 'react';
-
-import OverlayTrigger from 'components/overlay_trigger';
-import Tooltip from 'components/tooltip';
-
-type Props = {
- id?: string;
- content: ReactNode;
- children: ReactNode;
- className?: string;
- arrowOffsetTop?: number | string;
- style?: CSSProperties;
-}
-
-const SimpleTooltip = ({
- id,
- content,
- children,
- placement = 'top',
- className = 'hidden-xs',
- delayShow = 100,
- style,
- ...props
-}: Props & Omit, 'overlay'>) => {
- return (
-
- {content}
-
- }
- >
- {children}
-
- );
-};
-
-export default SimpleTooltip;