mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 04:59:15 -06:00
34 lines
739 B
TypeScript
34 lines
739 B
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import PluginListItem from './PluginListItem';
|
|
import { getMockPlugin } from './__mocks__/pluginMocks';
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
const props = Object.assign(
|
|
{
|
|
plugin: getMockPlugin(),
|
|
},
|
|
propOverrides
|
|
);
|
|
|
|
return shallow(<PluginListItem {...props} />);
|
|
};
|
|
|
|
describe('Render', () => {
|
|
it('should render component', () => {
|
|
const wrapper = setup();
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
it('should render has plugin section', () => {
|
|
const mockPlugin = getMockPlugin();
|
|
mockPlugin.hasUpdate = true;
|
|
const wrapper = setup({
|
|
plugin: mockPlugin,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|