grafana/public/app/core/components/sidemenu/SideMenuDropDown.test.tsx
Peter Holmberg cab6861d27 Reactify sidebar (#13091)
* created react component and moved markdown

* extracting components

* Broke out parts into components

* tests

* Flattened file structure

* Tests

* made instances typed in test

* typing

* function instead of variable

* updated user model with missing properties

* added full set of properties to user mock

* redone from variable to function

* refactor: minor refactorings of #13091

* removed logging
2018-09-04 17:24:08 +02:00

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();
});
});