cloudflare-pages.spec.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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/gettingStartedDoc/types';
  5. import docs from './cloudflare-pages';
  6. describe('express onboarding docs', function () {
  7. it('renders onboarding docs correctly', () => {
  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: 'Upload Source Maps'})).toBeInTheDocument();
  13. // Includes import statement
  14. const allMatches = screen.getAllByText(
  15. textWithMarkupMatcher(/import \* as Sentry from "@sentry\/cloudflare"/)
  16. );
  17. allMatches.forEach(match => {
  18. expect(match).toBeInTheDocument();
  19. });
  20. });
  21. it('displays sample rates by default', () => {
  22. renderWithOnboardingLayout(docs, {
  23. selectedProducts: [
  24. ProductSolution.ERROR_MONITORING,
  25. ProductSolution.PERFORMANCE_MONITORING,
  26. ProductSolution.PROFILING,
  27. ],
  28. });
  29. expect(
  30. screen.getByText(textWithMarkupMatcher(/tracesSampleRate/))
  31. ).toBeInTheDocument();
  32. });
  33. });