tryton.spec.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.queryByText(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.queryByText(
  56. textWithMarkupMatcher(/"continuous_profiling_auto_start": True,/)
  57. )
  58. ).toBeInTheDocument();
  59. });
  60. });