pluginIcon.spec.tsx 831 B

1234567891011121314151617181920212223
  1. /* eslint-disable jest/no-disabled-tests */
  2. import {render} from 'sentry-test/reactTestingLibrary';
  3. import PluginIcon from 'sentry/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/logos/logo-default.svg', () => 'default', {});
  7. jest.mock('images/logos/logo-github.svg', () => 'github', {});
  8. describe('PluginIcon', function () {
  9. it('renders', function () {
  10. const {container} = render(<PluginIcon pluginId="github" size={20} />);
  11. expect(container).toSnapshot();
  12. });
  13. // doesn't work because of the above comment
  14. it.skip('renders with default icon with invalid plugin id', function () {
  15. const {container} = render(<PluginIcon pluginId="invalid" size={20} />);
  16. expect(container).toSnapshot();
  17. });
  18. });