12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import {render, screen} from 'sentry-test/reactTestingLibrary';
- import Settings from 'sentry/views/settings/projectAlerts/settings';
- describe('ProjectAlertSettings', () => {
- const router = TestStubs.router();
- const organization = TestStubs.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();
- });
- });
|