wpf.spec.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 './wpf';
  6. describe('wpf onboarding docs', function () {
  7. it('renders errors onboarding docs correctly', async function () {
  8. renderWithOnboardingLayout(docs, {
  9. releaseRegistry: {
  10. 'sentry.dotnet': {
  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: 'Verify'})).toBeInTheDocument();
  19. expect(screen.getByRole('heading', {name: 'Tracing'})).toBeInTheDocument();
  20. expect(screen.getByRole('heading', {name: 'Documentation'})).toBeInTheDocument();
  21. expect(screen.getByRole('heading', {name: 'Samples'})).toBeInTheDocument();
  22. // Renders SDK version from registry
  23. expect(
  24. await screen.findByText(
  25. textWithMarkupMatcher(/Install-Package Sentry -Version 1\.99\.9/)
  26. )
  27. ).toBeInTheDocument();
  28. });
  29. it('renders performance onboarding docs correctly', async function () {
  30. renderWithOnboardingLayout(docs, {
  31. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  32. });
  33. expect(
  34. await screen.findByText(textWithMarkupMatcher(/o.TracesSampleRate/))
  35. ).toBeInTheDocument();
  36. });
  37. it('renders profiling onboarding docs correctly', async function () {
  38. renderWithOnboardingLayout(docs, {
  39. selectedProducts: [
  40. ProductSolution.PERFORMANCE_MONITORING,
  41. ProductSolution.PROFILING,
  42. ],
  43. });
  44. expect(
  45. await screen.findByText(textWithMarkupMatcher(/o.ProfilesSampleRate/))
  46. ).toBeInTheDocument();
  47. });
  48. });