pluginIcon.spec.jsx 852 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import {shallow} from 'enzyme';
  3. import PluginIcon from 'app/plugins/components/pluginIcon';
  4. // For some reason jest only respects the last mocked, so we can't test
  5. // two different images here
  6. // jest.mock('images/integrations/integration-default.png', () => 'default', {});
  7. jest.mock('images/integrations/github-logo.png', () => 'github', {});
  8. describe('PluginIcon', function() {
  9. it('renders', function() {
  10. let wrapper = shallow(<PluginIcon pluginId="github" size={20} />);
  11. expect(wrapper).toMatchSnapshot();
  12. });
  13. // doesn't work because of the above comment
  14. // eslint-disable-next-line jest/no-disabled-tests
  15. it.skip('renders with default icon with invalid plugin id', function() {
  16. let wrapper = shallow(<PluginIcon pluginId="invalid" size={20} />);
  17. expect(wrapper).toMatchSnapshot();
  18. });
  19. });