aspnet.spec.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 './aspnet';
  6. describe('aspnet onboarding docs', function () {
  7. it('renders errors onboarding docs correctly', async function () {
  8. renderWithOnboardingLayout(docs, {
  9. releaseRegistry: {
  10. 'sentry.dotnet.aspnet': {
  11. version: '1.99.9',
  12. },
  13. },
  14. });
  15. // Renders main headings
  16. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  17. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  18. expect(screen.getByRole('heading', {name: 'Documentation'})).toBeInTheDocument();
  19. expect(screen.getByRole('heading', {name: 'Samples'})).toBeInTheDocument();
  20. // Renders SDK version from registry
  21. expect(
  22. await screen.findByText(
  23. textWithMarkupMatcher(/Install-Package Sentry.AspNet -Version 1\.99\.9/)
  24. )
  25. ).toBeInTheDocument();
  26. });
  27. it('renders performance onboarding docs correctly', async function () {
  28. renderWithOnboardingLayout(docs, {
  29. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  30. });
  31. expect(
  32. await screen.findByText(textWithMarkupMatcher(/o.TracesSampleRate/))
  33. ).toBeInTheDocument();
  34. });
  35. });