import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; import InactivePlugins from 'sentry/components/inactivePlugins'; describe('InactivePlugins', function () { it('renders null when no plugins', function () { const {container} = render( {}} /> ); expect(container).toBeEmptyDOMElement(); }); it('renders plugins list', function () { const {container} = render( {}} plugins={TestStubs.Plugins()} /> ); expect(container).toSnapshot(); }); it('enables a plugin', function () { const enableFn = jest.fn(); const plugins = TestStubs.Plugins(); render(); userEvent.click(screen.getByRole('button', {name: plugins[0].name})); expect(enableFn).toHaveBeenCalledWith(expect.objectContaining(plugins[0])); }); });