nuxt.spec.tsx 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 './nuxt';
  6. describe('javascript-nuxt onboarding docs', function () {
  7. it('renders onboarding docs correctly', () => {
  8. renderWithOnboardingLayout(docs);
  9. // Renders main headings
  10. expect(
  11. screen.getByRole('heading', {name: 'Automatic Configuration (Recommended)'})
  12. ).toBeInTheDocument();
  13. // Renders main headings
  14. expect(
  15. screen.getByRole('heading', {name: 'Manual Configuration'})
  16. ).toBeInTheDocument();
  17. // Renders main headings
  18. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  19. // Includes configure statement
  20. expect(
  21. screen.getByText(textWithMarkupMatcher(/npx @sentry\/wizard@latest -i nuxt/))
  22. ).toBeInTheDocument();
  23. });
  24. it('displays the verify instructions', () => {
  25. renderWithOnboardingLayout(docs, {
  26. selectedProducts: [
  27. ProductSolution.ERROR_MONITORING,
  28. ProductSolution.PERFORMANCE_MONITORING,
  29. ProductSolution.SESSION_REPLAY,
  30. ],
  31. });
  32. expect(
  33. screen.queryByText(textWithMarkupMatcher(/sentry-example-page/))
  34. ).toBeInTheDocument();
  35. });
  36. });