mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 23:16:16 -06:00
* show signing status * show signing status * Progress on signed badge style * Progress on signing status look and updated card background * Updates * Transforms card tweak Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
import { PluginListPage, Props } from './PluginListPage';
|
|
import { NavModel, PluginMeta } from '@grafana/data';
|
|
import { mockToolkitActionCreator } from 'test/core/redux/mocks';
|
|
import { setPluginsSearchQuery } from './state/reducers';
|
|
|
|
const setup = (propOverrides?: object) => {
|
|
const props: Props = {
|
|
navModel: {
|
|
main: {
|
|
text: 'Configuration',
|
|
},
|
|
node: {
|
|
text: 'Plugins',
|
|
},
|
|
} as NavModel,
|
|
plugins: [] as PluginMeta[],
|
|
searchQuery: '',
|
|
setPluginsSearchQuery: mockToolkitActionCreator(setPluginsSearchQuery),
|
|
loadPlugins: jest.fn(),
|
|
hasFetched: false,
|
|
};
|
|
|
|
Object.assign(props, propOverrides);
|
|
|
|
return shallow(<PluginListPage {...props} />);
|
|
};
|
|
|
|
describe('Render', () => {
|
|
it('should render component', () => {
|
|
const wrapper = setup();
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
|
|
it('should render list', () => {
|
|
const wrapper = setup({
|
|
hasFetched: true,
|
|
});
|
|
|
|
expect(wrapper).toMatchSnapshot();
|
|
});
|
|
});
|