react-native.spec.tsx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 './react-native';
  6. describe('getting started with react-native', 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. expect(screen.getByRole('heading', {name: 'Tracing'})).toBeInTheDocument();
  14. expect(screen.getByRole('heading', {name: 'Debug Symbols'})).toBeInTheDocument();
  15. expect(screen.getByRole('heading', {name: 'Source Context'})).toBeInTheDocument();
  16. });
  17. it('renders performance onboarding docs correctly', async function () {
  18. renderWithOnboardingLayout(docs, {
  19. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  20. });
  21. expect(
  22. await screen.findByText(textWithMarkupMatcher(/tracesSampleRate/))
  23. ).toBeInTheDocument();
  24. expect(
  25. await screen.findByText(
  26. textWithMarkupMatcher(/Sentry can measure the performance of your app/)
  27. )
  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(/profilesSampleRate/))
  39. ).toBeInTheDocument();
  40. expect(
  41. await screen.findByText(
  42. textWithMarkupMatcher(/React Native Profiling beta is available/)
  43. )
  44. ).toBeInTheDocument();
  45. });
  46. });