deno.spec.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  2. import {screen} from 'sentry-test/reactTestingLibrary';
  3. import {textWithMarkupMatcher} from 'sentry-test/utils';
  4. import docs from './deno';
  5. describe('deno onboarding docs', function () {
  6. it('renders doc correctly', function () {
  7. renderWithOnboardingLayout(docs);
  8. // Renders main headings
  9. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  10. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  11. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  12. // Renders config options
  13. expect(
  14. screen.getByText(textWithMarkupMatcher(/tracesSampleRate: 1\.0,/))
  15. ).toBeInTheDocument();
  16. });
  17. it('renders without performance monitoring', function () {
  18. renderWithOnboardingLayout(docs, {
  19. selectedProducts: [],
  20. });
  21. // Does not render config option
  22. expect(
  23. screen.queryByText(textWithMarkupMatcher(/tracesSampleRate: 1\.0,/))
  24. ).not.toBeInTheDocument();
  25. // Renders next steps
  26. expect(
  27. screen.getByRole('link', {name: 'Performance Monitoring'})
  28. ).toBeInTheDocument();
  29. });
  30. });