aspnetcore.spec.tsx 1.9 KB

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