PluginListPage.test.tsx 707 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import { shallow } from 'enzyme';
  3. import { PluginListPage, Props } from './PluginListPage';
  4. import { NavModel, Plugin } from '../../types';
  5. const setup = (propOverrides?: object) => {
  6. const props: Props = {
  7. navModel: {} as NavModel,
  8. plugins: [] as Plugin[],
  9. layoutMode: 'grid',
  10. loadPlugins: jest.fn(),
  11. };
  12. Object.assign(props, propOverrides);
  13. const wrapper = shallow(<PluginListPage {...props} />);
  14. const instance = wrapper.instance() as PluginListPage;
  15. return {
  16. wrapper,
  17. instance,
  18. };
  19. };
  20. describe('Render', () => {
  21. it('should render component', () => {
  22. const { wrapper } = setup();
  23. expect(wrapper).toMatchSnapshot();
  24. });
  25. });