1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/menu/__tests__/footer-test.jsx

50 lines
1.3 KiB
React
Raw Normal View History

import React from 'react';
import renderer from 'react-test-renderer';
import { MemoryRouter } from 'react-router-dom';
import { ThemeProvider } from '@material-ui/core';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import Footer from '../Footer/Footer';
import theme from '../../../themes/main-theme';
const mockStore = {
uiConfig: {
toJS: () => ({
flags: {
P: true,
},
}),
},
};
const mockReducer = state => state;
test('should render DrawerMenu', () => {
const tree = renderer.create(
<Provider store={createStore(mockReducer, mockStore)}>
<ThemeProvider theme={theme}>
<MemoryRouter>
<Footer />
</MemoryRouter>
</ThemeProvider>
</Provider>
);
expect(tree).toMatchSnapshot();
});
test('should render DrawerMenu with "features" selected', () => {
const tree = renderer.create(
<Provider store={createStore(mockReducer, mockStore)}>
<ThemeProvider theme={theme}>
<MemoryRouter initialEntries={['/features']}>
<Footer />
</MemoryRouter>
</ThemeProvider>
</Provider>
);
expect(tree).toMatchSnapshot();
});