android.spec.tsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  2. import {screen} from 'sentry-test/reactTestingLibrary';
  3. import {textWithMarkupMatcher} from 'sentry-test/utils';
  4. import docs, {InstallationMode} from './android';
  5. describe('java-spring-boot onboarding docs', function () {
  6. it('renders gradle docs correctly', async function () {
  7. renderWithOnboardingLayout(docs, {
  8. releaseRegistry: {
  9. 'sentry.java.android.gradle-plugin': {
  10. version: '1.99.9',
  11. },
  12. },
  13. selectedOptions: {
  14. installationMode: InstallationMode.MANUAL,
  15. },
  16. });
  17. // Renders main headings
  18. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  19. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  20. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  21. // Renders SDK version from registry
  22. expect(
  23. await screen.findByText(
  24. textWithMarkupMatcher(/id "io\.sentry\.android\.gradle" version "1\.99\.9"/)
  25. )
  26. ).toBeInTheDocument();
  27. });
  28. it('renders wizard docs', async function () {
  29. renderWithOnboardingLayout(docs, {
  30. releaseRegistry: {
  31. 'sentry.java.spring-boot.jakarta': {
  32. version: '2.99.9',
  33. },
  34. 'sentry.java.mavenplugin': {
  35. version: '3.99.9',
  36. },
  37. },
  38. selectedOptions: {
  39. installationMode: InstallationMode.AUTO,
  40. },
  41. });
  42. // Renders main headings
  43. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  44. expect(
  45. screen.queryByRole('heading', {name: 'Configure SDK'})
  46. ).not.toBeInTheDocument();
  47. expect(screen.queryByRole('heading', {name: 'Verify'})).not.toBeInTheDocument();
  48. // Renders SDK version from registry
  49. expect(
  50. await screen.findByText(
  51. textWithMarkupMatcher(
  52. /Add Sentry automatically to your app with the Sentry wizard/m
  53. )
  54. )
  55. ).toBeInTheDocument();
  56. });
  57. });