nextjs.spec.tsx 1.3 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 {ProductSolution} from 'sentry/components/onboarding/productSelection';
  5. import docs from './nextjs';
  6. describe('javascript-nextjs 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. // Includes configure statement
  12. expect(
  13. screen.getByText(textWithMarkupMatcher(/npx @sentry\/wizard@latest -i nextjs/))
  14. ).toBeInTheDocument();
  15. });
  16. it('displays the configure instructions', () => {
  17. renderWithOnboardingLayout(docs, {
  18. selectedProducts: [
  19. ProductSolution.ERROR_MONITORING,
  20. ProductSolution.PERFORMANCE_MONITORING,
  21. ProductSolution.SESSION_REPLAY,
  22. ],
  23. });
  24. expect(
  25. screen.queryByText(textWithMarkupMatcher(/sentry.client.config.js/))
  26. ).toBeInTheDocument();
  27. expect(screen.queryByText(textWithMarkupMatcher(/Sentry.init/))).toBeInTheDocument();
  28. expect(screen.queryByText(textWithMarkupMatcher(/.sentryclirc/))).toBeInTheDocument();
  29. });
  30. });