rq.spec.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  2. import {screen} from 'sentry-test/reactTestingLibrary';
  3. import {textWithMarkupMatcher} from 'sentry-test/utils';
  4. import docs from './rq';
  5. describe('rq onboarding docs', function () {
  6. it('renders doc correctly', function () {
  7. renderWithOnboardingLayout(docs);
  8. // Renders main headings
  9. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  10. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  11. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  12. expect(screen.getByRole('heading', {name: 'Job definition'})).toBeInTheDocument();
  13. expect(
  14. screen.getByRole('heading', {name: 'Settings for worker'})
  15. ).toBeInTheDocument();
  16. expect(screen.getByRole('heading', {name: 'Main Python Script'})).toBeInTheDocument();
  17. // Renders install instructions
  18. expect(
  19. screen.getByText(textWithMarkupMatcher(/pip install --upgrade 'sentry-sdk\[rq\]'/))
  20. ).toBeInTheDocument();
  21. });
  22. it('renders without performance monitoring', function () {
  23. renderWithOnboardingLayout(docs, {
  24. selectedProducts: [],
  25. });
  26. // Does not render config option
  27. expect(
  28. screen.queryByText(textWithMarkupMatcher(/traces_sample_rate: 1\.0,/))
  29. ).not.toBeInTheDocument();
  30. // Does not render config option
  31. expect(
  32. screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/))
  33. ).not.toBeInTheDocument();
  34. });
  35. });