tryton.spec.tsx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import {OrganizationFixture} from 'sentry-fixture/organization';
  2. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  3. import {screen} from 'sentry-test/reactTestingLibrary';
  4. import {textWithMarkupMatcher} from 'sentry-test/utils';
  5. import docs from './tryton';
  6. describe('tryton onboarding docs', function () {
  7. it('renders doc correctly', function () {
  8. renderWithOnboardingLayout(docs);
  9. // Renders main headings
  10. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  11. });
  12. it('renders without tracing', function () {
  13. renderWithOnboardingLayout(docs, {
  14. selectedProducts: [],
  15. });
  16. // Does not render config option
  17. expect(
  18. screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/))
  19. ).not.toBeInTheDocument();
  20. // Does not render config option
  21. expect(
  22. screen.queryByText(textWithMarkupMatcher(/traces_sample_rate=1\.0,/))
  23. ).not.toBeInTheDocument();
  24. });
  25. it('renders transaction profiling', function () {
  26. renderWithOnboardingLayout(docs);
  27. // Does not render continuous profiling config
  28. expect(
  29. screen.queryByText(
  30. textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)
  31. )
  32. ).not.toBeInTheDocument();
  33. // Does render transaction profiling config
  34. expect(
  35. screen.getByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/))
  36. ).toBeInTheDocument();
  37. });
  38. it('renders continuous profiling', function () {
  39. const organization = OrganizationFixture({
  40. features: ['continuous-profiling'],
  41. });
  42. renderWithOnboardingLayout(
  43. docs,
  44. {},
  45. {
  46. organization,
  47. }
  48. );
  49. // Does not render transaction profiling config
  50. expect(
  51. screen.queryByText(textWithMarkupMatcher(/profiles_sample_rate=1\.0,/))
  52. ).not.toBeInTheDocument();
  53. // Does render continuous profiling config
  54. expect(
  55. screen.getByText(textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/))
  56. ).toBeInTheDocument();
  57. });
  58. });