macos.spec.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 './macos';
  6. describe('apple-macos onboarding docs', function () {
  7. it('renders docs correctly', async function () {
  8. renderWithOnboardingLayout(docs, {
  9. releaseRegistry: {
  10. 'sentry.cocoa': {
  11. version: '1.99.9',
  12. },
  13. },
  14. });
  15. // Renders main headings
  16. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  17. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  18. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  19. // Renders SDK version from registry
  20. expect(
  21. await screen.findByText(
  22. textWithMarkupMatcher(
  23. /\.package\(url: "https:\/\/github.com\/getsentry\/sentry-cocoa", from: "1\.99\.9"\),/
  24. )
  25. )
  26. ).toBeInTheDocument();
  27. });
  28. it('renders performance onboarding docs correctly', async function () {
  29. renderWithOnboardingLayout(docs, {
  30. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  31. });
  32. expect(
  33. await screen.findAllByText(textWithMarkupMatcher(/options.tracesSampleRate/))
  34. ).toHaveLength(2);
  35. });
  36. it('renders profiling onboarding docs correctly', async function () {
  37. renderWithOnboardingLayout(docs, {
  38. selectedProducts: [
  39. ProductSolution.PERFORMANCE_MONITORING,
  40. ProductSolution.PROFILING,
  41. ],
  42. });
  43. expect(
  44. await screen.findAllByText(textWithMarkupMatcher(/options.profilesSampleRate/))
  45. ).toHaveLength(2);
  46. });
  47. });