123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import {Organization} from 'sentry-fixture/organization';
- import {render, screen} from 'sentry-test/reactTestingLibrary';
- import Settings from 'sentry/views/settings/projectAlerts/settings';
- describe('ProjectAlertSettings', () => {
- const router = TestStubs.router();
- const organization = Organization();
- // 12 minutes
- const digestsMinDelay = 12 * 60;
- // 55 minutes
- const digestsMaxDelay = 55 * 60;
- const project = TestStubs.Project({
- digestsMinDelay,
- digestsMaxDelay,
- });
- beforeEach(() => {
- MockApiClient.addMockResponse({
- url: `/projects/${organization.slug}/${project.slug}/`,
- method: 'GET',
- body: project,
- });
- MockApiClient.addMockResponse({
- url: `/projects/${organization.slug}/${project.slug}/plugins/`,
- method: 'GET',
- body: [],
- });
- });
- it('renders', () => {
- render(
- <Settings
- canEditRule
- params={{projectId: project.slug}}
- organization={organization}
- routes={[]}
- router={router}
- routeParams={router.params}
- route={router.routes[0]}
- location={router.location}
- />
- );
- expect(screen.getByPlaceholderText('e.g. $shortID - $title')).toBeInTheDocument();
- expect(
- screen.getByRole('slider', {name: 'Minimum delivery interval'})
- ).toBeInTheDocument();
- expect(
- screen.getByRole('slider', {name: 'Maximum delivery interval'})
- ).toBeInTheDocument();
- expect(
- screen.getByText(
- "Oops! Looks like there aren't any available integrations installed."
- )
- ).toBeInTheDocument();
- });
- });
|