mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
27 lines
945 B
TypeScript
27 lines
945 B
TypeScript
import {PluginsFixture} from 'sentry-fixture/plugins';
|
|
|
|
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(
|
|
<InactivePlugins plugins={[]} onEnablePlugin={() => {}} />
|
|
);
|
|
expect(container).toBeEmptyDOMElement();
|
|
});
|
|
|
|
it('renders plugins list', function () {
|
|
render(<InactivePlugins onEnablePlugin={() => {}} plugins={PluginsFixture()} />);
|
|
});
|
|
|
|
it('enables a plugin', async function () {
|
|
const enableFn = jest.fn();
|
|
const plugins = PluginsFixture();
|
|
render(<InactivePlugins onEnablePlugin={enableFn} plugins={plugins} />);
|
|
await userEvent.click(screen.getByRole('button', {name: plugins[0].name}));
|
|
expect(enableFn).toHaveBeenCalledWith(expect.objectContaining(plugins[0]));
|
|
});
|
|
});
|