|
@@ -1,23 +1,19 @@
|
|
|
import React from 'react';
|
|
|
-import { mount } from 'enzyme';
|
|
|
import { StaticRouter } from 'react-router';
|
|
|
import { Cluster, ClusterFeaturesEnum } from 'generated-sources';
|
|
|
import { onlineClusterPayload } from 'redux/reducers/clusters/__test__/fixtures';
|
|
|
import ClusterMenu from 'components/Nav/ClusterMenu';
|
|
|
-import { ThemeProvider } from 'styled-components';
|
|
|
-import theme from 'theme/theme';
|
|
|
+import { mountWithTheme } from 'lib/testHelpers';
|
|
|
|
|
|
describe('ClusterMenu', () => {
|
|
|
const setupComponent = (cluster: Cluster) => (
|
|
|
- <ThemeProvider theme={theme}>
|
|
|
- <StaticRouter>
|
|
|
- <ClusterMenu cluster={cluster} />
|
|
|
- </StaticRouter>
|
|
|
- </ThemeProvider>
|
|
|
+ <StaticRouter>
|
|
|
+ <ClusterMenu cluster={cluster} />
|
|
|
+ </StaticRouter>
|
|
|
);
|
|
|
|
|
|
it('renders cluster menu without Kafka Connect & Schema Registry', () => {
|
|
|
- const wrapper = mount(setupComponent(onlineClusterPayload));
|
|
|
+ const wrapper = mountWithTheme(setupComponent(onlineClusterPayload));
|
|
|
expect(wrapper.find('ul.menu-list > li > NavLink').text()).toEqual(
|
|
|
onlineClusterPayload.name
|
|
|
);
|
|
@@ -26,7 +22,7 @@ describe('ClusterMenu', () => {
|
|
|
});
|
|
|
|
|
|
it('renders cluster menu with all enabled features', () => {
|
|
|
- const wrapper = mount(
|
|
|
+ const wrapper = mountWithTheme(
|
|
|
setupComponent({
|
|
|
...onlineClusterPayload,
|
|
|
features: [
|