rails.spec.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  2. import {screen} from 'sentry-test/reactTestingLibrary';
  3. import {textWithMarkupMatcher} from 'sentry-test/utils';
  4. import {ProductSolution} from 'sentry/components/onboarding/productSelection';
  5. import docs from './rails';
  6. describe('rails onboarding docs', function () {
  7. it('renders errors onboarding doc correctly', function () {
  8. renderWithOnboardingLayout(docs);
  9. // Renders main headings
  10. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  11. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  12. expect(screen.getByRole('heading', {name: 'Caveats'})).toBeInTheDocument();
  13. // Renders config options
  14. expect(
  15. screen.getByText(textWithMarkupMatcher(/config.breadcrumbs_logger/))
  16. ).toBeInTheDocument();
  17. // Renders import
  18. expect(
  19. screen.getByText(textWithMarkupMatcher(/gem \"sentry-ruby\"/))
  20. ).toBeInTheDocument();
  21. });
  22. it('renders performance onboarding docs correctly', async function () {
  23. renderWithOnboardingLayout(docs, {
  24. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  25. });
  26. expect(
  27. await screen.findByText(textWithMarkupMatcher(/config.traces_sample_rate/))
  28. ).toBeInTheDocument();
  29. });
  30. it('renders profiling onboarding docs correctly', async function () {
  31. renderWithOnboardingLayout(docs, {
  32. selectedProducts: [
  33. ProductSolution.PERFORMANCE_MONITORING,
  34. ProductSolution.PROFILING,
  35. ],
  36. });
  37. expect(
  38. await screen.findByText(textWithMarkupMatcher(/config.profiles_sample_rate/))
  39. ).toBeInTheDocument();
  40. expect(
  41. await screen.findByText(textWithMarkupMatcher(/Ruby Profiling beta is available/))
  42. ).toBeInTheDocument();
  43. expect(
  44. await screen.findByText(
  45. textWithMarkupMatcher(/Make sure stackprof is loaded before sentry-ruby/)
  46. )
  47. ).toBeInTheDocument();
  48. });
  49. });