ios.spec.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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, {InstallationMode} from './ios';
  6. describe('apple-ios onboarding docs', function () {
  7. it('renders 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(
  14. screen.getByRole('heading', {name: 'Experimental Features'})
  15. ).toBeInTheDocument();
  16. });
  17. it('renders performance onboarding docs correctly', async function () {
  18. renderWithOnboardingLayout(docs, {
  19. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  20. selectedOptions: {
  21. installationMode: InstallationMode.MANUAL,
  22. },
  23. });
  24. expect(
  25. await screen.findAllByText(textWithMarkupMatcher(/options.tracesSampleRate/))
  26. ).toHaveLength(2);
  27. });
  28. it('renders profiling onboarding docs correctly', async function () {
  29. renderWithOnboardingLayout(docs, {
  30. selectedProducts: [
  31. ProductSolution.PERFORMANCE_MONITORING,
  32. ProductSolution.PROFILING,
  33. ],
  34. selectedOptions: {
  35. installationMode: InstallationMode.MANUAL,
  36. },
  37. });
  38. expect(
  39. await screen.findAllByText(textWithMarkupMatcher(/options.profilesSampleRate/))
  40. ).toHaveLength(2);
  41. });
  42. });