pluginIcon.spec.jsx 860 B

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