2018-08-06 22:16:36 +02:00
|
|
|
import React from 'react';
|
|
|
|
import renderer from 'react-test-renderer';
|
|
|
|
import { MemoryRouter } from 'react-router-dom';
|
2021-04-12 15:04:03 +02:00
|
|
|
import { ThemeProvider } from '@material-ui/core';
|
|
|
|
import { Provider } from 'react-redux';
|
|
|
|
import { createStore } from 'redux';
|
2018-08-06 22:16:36 +02:00
|
|
|
|
2021-03-30 15:14:02 +02:00
|
|
|
import Footer from '../Footer/Footer';
|
2021-04-12 15:04:03 +02:00
|
|
|
import theme from '../../../themes/main-theme';
|
2018-08-06 22:16:36 +02:00
|
|
|
|
2021-04-12 15:04:03 +02:00
|
|
|
const mockStore = {
|
|
|
|
uiConfig: {
|
|
|
|
toJS: () => ({
|
|
|
|
flags: {
|
|
|
|
P: true,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const mockReducer = state => state;
|
2018-08-06 22:16:36 +02:00
|
|
|
|
|
|
|
test('should render DrawerMenu', () => {
|
|
|
|
const tree = renderer.create(
|
2021-04-12 15:04:03 +02:00
|
|
|
<Provider store={createStore(mockReducer, mockStore)}>
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<MemoryRouter>
|
|
|
|
<Footer />
|
|
|
|
</MemoryRouter>
|
|
|
|
</ThemeProvider>
|
|
|
|
</Provider>
|
2018-08-06 22:16:36 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
|
|
|
|
test('should render DrawerMenu with "features" selected', () => {
|
|
|
|
const tree = renderer.create(
|
2021-04-12 15:04:03 +02:00
|
|
|
<Provider store={createStore(mockReducer, mockStore)}>
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<MemoryRouter initialEntries={['/features']}>
|
|
|
|
<Footer />
|
|
|
|
</MemoryRouter>
|
|
|
|
</ThemeProvider>
|
|
|
|
</Provider>
|
2018-08-06 22:16:36 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
expect(tree).toMatchSnapshot();
|
|
|
|
});
|