grafana/public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.test.tsx
Dominik Prokop 40114e8c07
NewPanelEditor: UI update of add panel widget (#23715)
* Small update proposal to add panel widget

* Fix smoketest

* Minor tweaks

* update snaps god damn it
2020-04-21 13:40:49 +02:00

26 lines
657 B
TypeScript

import React from 'react';
import { shallow } from 'enzyme';
import { AddPanelWidgetUnconnected as AddPanelWidget, Props } from './AddPanelWidget';
import { DashboardModel, PanelModel } from '../../state';
const setup = (propOverrides?: object) => {
const props: Props = {
dashboard: {} as DashboardModel,
panel: {} as PanelModel,
addPanel: jest.fn() as any,
updateLocation: jest.fn() as any,
};
Object.assign(props, propOverrides);
return shallow(<AddPanelWidget {...props} />);
};
describe('Render', () => {
it('should render component', () => {
const wrapper = setup();
expect(wrapper).toMatchSnapshot();
});
});