flutter.spec.tsx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 './flutter';
  6. describe('flutter onboarding docs', function () {
  7. it('renders errors onboarding docs correctly', async function () {
  8. renderWithOnboardingLayout(docs, {
  9. releaseRegistry: {
  10. 'sentry.dart.flutter': {
  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. // Renders SDK version from registry
  20. expect(
  21. await screen.findByText(textWithMarkupMatcher(/sentry_flutter: \^1\.99\.9/))
  22. ).toBeInTheDocument();
  23. });
  24. it('renders performance onboarding docs correctly', async function () {
  25. renderWithOnboardingLayout(docs, {
  26. releaseRegistry: {
  27. 'sentry.dart.flutter': {
  28. version: '1.99.9',
  29. },
  30. },
  31. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  32. });
  33. expect(
  34. await screen.findByText(textWithMarkupMatcher(/options.tracesSampleRate/))
  35. ).toBeInTheDocument();
  36. expect(
  37. await screen.findByText(
  38. textWithMarkupMatcher(
  39. /You'll be able to monitor the performance of your app using the SDK./
  40. )
  41. )
  42. ).toBeInTheDocument();
  43. });
  44. it('renders profiling onboarding docs correctly', async function () {
  45. renderWithOnboardingLayout(docs, {
  46. releaseRegistry: {
  47. 'sentry.dart.flutter': {
  48. version: '1.99.9',
  49. },
  50. },
  51. selectedProducts: [
  52. ProductSolution.PERFORMANCE_MONITORING,
  53. ProductSolution.PROFILING,
  54. ],
  55. });
  56. expect(
  57. await screen.findByText(textWithMarkupMatcher(/options.profilesSampleRate/))
  58. ).toBeInTheDocument();
  59. expect(
  60. await screen.findByText(
  61. textWithMarkupMatcher(/Flutter Profiling alpha is available/)
  62. )
  63. ).toBeInTheDocument();
  64. });
  65. });