mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
36 lines
667 B
TypeScript
36 lines
667 B
TypeScript
|
import React from 'react';
|
||
|
import { shallow } from 'enzyme';
|
||
|
import DropDownChild from './DropDownChild';
|
||
|
|
||
|
const setup = (propOverrides?: object) => {
|
||
|
const props = Object.assign(
|
||
|
{
|
||
|
child: {
|
||
|
divider: true,
|
||
|
},
|
||
|
},
|
||
|
propOverrides
|
||
|
);
|
||
|
|
||
|
return shallow(<DropDownChild {...props} />);
|
||
|
};
|
||
|
|
||
|
describe('Render', () => {
|
||
|
it('should render component', () => {
|
||
|
const wrapper = setup();
|
||
|
|
||
|
expect(wrapper).toMatchSnapshot();
|
||
|
});
|
||
|
|
||
|
it('should render icon if exists', () => {
|
||
|
const wrapper = setup({
|
||
|
child: {
|
||
|
divider: false,
|
||
|
icon: 'icon-test',
|
||
|
},
|
||
|
});
|
||
|
|
||
|
expect(wrapper).toMatchSnapshot();
|
||
|
});
|
||
|
});
|