celery.spec.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 './celery';
  5. describe('celery 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: 'Standalone Setup'})).toBeInTheDocument();
  12. expect(screen.getByRole('heading', {name: 'Setup With Django'})).toBeInTheDocument();
  13. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  14. // Renders install instructions
  15. expect(
  16. screen.getByText(
  17. textWithMarkupMatcher(/pip install --upgrade 'sentry-sdk\[celery\]'/)
  18. )
  19. ).toBeInTheDocument();
  20. });
  21. it('renders without performance monitoring', function () {
  22. renderWithOnboardingLayout(docs, {
  23. selectedProducts: [],
  24. });
  25. // Does not render config option
  26. expect(
  27. screen.queryByText(textWithMarkupMatcher(/traces_sample_rate: 1\.0,/))
  28. ).not.toBeInTheDocument();
  29. // Does not render config option
  30. expect(
  31. screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate: 1\.0,/))
  32. ).not.toBeInTheDocument();
  33. });
  34. });