mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import {PluginsFixture} from 'sentry-fixture/plugins';
|
|
|
|
import {initializeOrg} from 'sentry-test/initializeOrg';
|
|
import {render, screen, waitFor} from 'sentry-test/reactTestingLibrary';
|
|
|
|
import ProjectPlugins from 'sentry/views/settings/projectPlugins/projectPlugins';
|
|
|
|
describe('ProjectPlugins', function () {
|
|
it('renders', async function () {
|
|
const {organization, routerProps, project} = initializeOrg();
|
|
|
|
render(
|
|
<ProjectPlugins
|
|
{...routerProps}
|
|
organization={organization}
|
|
params={{
|
|
orgId: organization.slug,
|
|
}}
|
|
project={project}
|
|
onChange={jest.fn()}
|
|
loading={false}
|
|
error={undefined}
|
|
plugins={PluginsFixture()}
|
|
/>
|
|
);
|
|
|
|
await waitFor(() =>
|
|
expect(screen.queryByTestId('loading-indicator')).not.toBeInTheDocument()
|
|
);
|
|
});
|
|
|
|
it('has error state when plugins=[]', async function () {
|
|
const {organization, routerProps, project} = initializeOrg();
|
|
|
|
render(
|
|
<ProjectPlugins
|
|
{...routerProps}
|
|
organization={organization}
|
|
params={{
|
|
orgId: organization.slug,
|
|
}}
|
|
project={project}
|
|
onChange={jest.fn()}
|
|
loading={false}
|
|
error={new Error('An error')}
|
|
plugins={[]}
|
|
/>
|
|
);
|
|
|
|
expect(await screen.findByText('Oops! Something went wrong')).toBeInTheDocument();
|
|
});
|
|
});
|