2019-02-05 05:47:42 -06:00
|
|
|
import React from 'react';
|
|
|
|
import { shallow } from 'enzyme';
|
2020-02-10 07:23:54 -06:00
|
|
|
import { AddPanelWidgetUnconnected as AddPanelWidget, Props } from './AddPanelWidget';
|
2019-02-05 05:47:42 -06:00
|
|
|
import { DashboardModel, PanelModel } from '../../state';
|
|
|
|
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
|
|
const props: Props = {
|
|
|
|
dashboard: {} as DashboardModel,
|
|
|
|
panel: {} as PanelModel,
|
2020-02-10 07:23:54 -06:00
|
|
|
addPanelToDashboard: jest.fn() as any,
|
2019-02-05 05:47:42 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
|
|
|
|
return shallow(<AddPanelWidget {...props} />);
|
|
|
|
};
|
|
|
|
|
|
|
|
describe('Render', () => {
|
|
|
|
it('should render component', () => {
|
|
|
|
const wrapper = setup();
|
|
|
|
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
|
|
});
|
|
|
|
});
|