settings.spec.jsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {Client} from 'sentry/api';
  3. import Settings from 'sentry/views/settings/projectAlerts/settings';
  4. describe('ProjectAlertSettings', () => {
  5. const organization = TestStubs.Organization();
  6. // 12 minutes
  7. const digestsMinDelay = 12 * 60;
  8. // 55 minutes
  9. const digestsMaxDelay = 55 * 60;
  10. const project = TestStubs.Project({
  11. digestsMinDelay,
  12. digestsMaxDelay,
  13. });
  14. beforeEach(() => {
  15. Client.addMockResponse({
  16. url: `/projects/${organization.slug}/${project.slug}/`,
  17. method: 'GET',
  18. body: project,
  19. });
  20. Client.addMockResponse({
  21. url: `/projects/${organization.slug}/${project.slug}/plugins/`,
  22. method: 'GET',
  23. body: [],
  24. });
  25. });
  26. it('renders', () => {
  27. render(
  28. <Settings
  29. canEditRule
  30. params={{orgId: organization.slug, projectId: project.slug}}
  31. organization={organization}
  32. routes={[]}
  33. />
  34. );
  35. expect(screen.getByPlaceholderText('e.g. $shortID - $title')).toBeInTheDocument();
  36. expect(
  37. screen.getByRole('slider', {name: 'Minimum delivery interval'})
  38. ).toBeInTheDocument();
  39. expect(
  40. screen.getByRole('slider', {name: 'Maximum delivery interval'})
  41. ).toBeInTheDocument();
  42. expect(
  43. screen.getByText(
  44. "Oops! Looks like there aren't any available integrations installed."
  45. )
  46. ).toBeInTheDocument();
  47. });
  48. });