2018-09-26 15:12:06 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import { shallow } from 'enzyme';
|
|
|
|
|
import { PluginActionBar, Props } from './PluginActionBar';
|
2018-09-27 12:15:41 +02:00
|
|
|
import { LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
|
2018-09-26 15:12:06 +02:00
|
|
|
|
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
|
|
|
const props: Props = {
|
|
|
|
|
searchQuery: '',
|
2018-09-27 12:15:41 +02:00
|
|
|
layoutMode: LayoutModes.Grid,
|
2018-09-26 15:12:06 +02:00
|
|
|
setLayoutMode: jest.fn(),
|
|
|
|
|
setPluginsSearchQuery: jest.fn(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
|
|
|
|
|
|
const wrapper = shallow(<PluginActionBar {...props} />);
|
|
|
|
|
const instance = wrapper.instance() as PluginActionBar;
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
wrapper,
|
|
|
|
|
instance,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
describe('Render', () => {
|
|
|
|
|
it('should render component', () => {
|
|
|
|
|
const { wrapper } = setup();
|
|
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
|
});
|
|
|
|
|
});
|