ruby.spec.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 './ruby';
  6. describe('getting started with ruby', function () {
  7. it('renders errors onboarding docs 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: 'Verify'})).toBeInTheDocument();
  13. });
  14. it('renders performance onboarding docs correctly', async function () {
  15. renderWithOnboardingLayout(docs, {
  16. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  17. });
  18. expect(
  19. await screen.findByText(textWithMarkupMatcher(/config.traces_sample_rate/))
  20. ).toBeInTheDocument();
  21. });
  22. it('renders profiling onboarding docs correctly', async function () {
  23. renderWithOnboardingLayout(docs, {
  24. selectedProducts: [
  25. ProductSolution.PERFORMANCE_MONITORING,
  26. ProductSolution.PROFILING,
  27. ],
  28. });
  29. expect(
  30. await screen.findByText(textWithMarkupMatcher(/config.profiles_sample_rate/))
  31. ).toBeInTheDocument();
  32. expect(
  33. await screen.findByText(textWithMarkupMatcher(/Ruby Profiling beta is available/))
  34. ).toBeInTheDocument();
  35. expect(
  36. await screen.findByText(
  37. textWithMarkupMatcher(/Make sure stackprof is loaded before sentry-ruby/)
  38. )
  39. ).toBeInTheDocument();
  40. });
  41. });