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