import {mountWithTheme} from 'sentry-test/enzyme'; import InactivePlugins from 'app/components/inactivePlugins'; describe('InactivePlugins', function () { it('renders null when no plugins', function () { const wrapper = mountWithTheme( {}} /> ); expect(wrapper).toSnapshot(); }); it('renders plugins list', function () { const wrapper = mountWithTheme( {}} plugins={TestStubs.Plugins()} /> ); expect(wrapper).toSnapshot(); }); it('enables a plugin', function () { const enableFn = jest.fn(); const plugins = TestStubs.Plugins(); const wrapper = mountWithTheme( ); wrapper.find('button').first().simulate('click'); expect(enableFn).toHaveBeenCalledWith(expect.objectContaining(plugins[0])); }); });