mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
36 lines
691 B
TypeScript
36 lines
691 B
TypeScript
|
import React from 'react';
|
||
|
import { shallow } from 'enzyme';
|
||
|
import SideMenuDropDown from './SideMenuDropDown';
|
||
|
|
||
|
const setup = (propOverrides?: object) => {
|
||
|
const props = Object.assign(
|
||
|
{
|
||
|
link: {
|
||
|
text: 'link',
|
||
|
},
|
||
|
},
|
||
|
propOverrides
|
||
|
);
|
||
|
|
||
|
return shallow(<SideMenuDropDown {...props} />);
|
||
|
};
|
||
|
|
||
|
describe('Render', () => {
|
||
|
it('should render component', () => {
|
||
|
const wrapper = setup();
|
||
|
|
||
|
expect(wrapper).toMatchSnapshot();
|
||
|
});
|
||
|
|
||
|
it('should render children', () => {
|
||
|
const wrapper = setup({
|
||
|
link: {
|
||
|
text: 'link',
|
||
|
children: [{ id: 1 }, { id: 2 }, { id: 3 }],
|
||
|
},
|
||
|
});
|
||
|
|
||
|
expect(wrapper).toMatchSnapshot();
|
||
|
});
|
||
|
});
|