spring-boot.spec.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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, {PackageManager, SpringBootVersion} from './spring-boot';
  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. });
  14. // Renders main headings
  15. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  16. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  17. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  18. // Renders SDK version from registry
  19. expect(
  20. await screen.findByText(
  21. textWithMarkupMatcher(/id "io\.sentry\.jvm\.gradle" version "1\.99\.9"/)
  22. )
  23. ).toBeInTheDocument();
  24. });
  25. it('renders maven docs correctly', async function () {
  26. renderWithOnboardingLayout(docs, {
  27. releaseRegistry: {
  28. 'sentry.java.spring-boot.jakarta': {
  29. version: '2.99.9',
  30. },
  31. 'sentry.java.mavenplugin': {
  32. version: '3.99.9',
  33. },
  34. },
  35. selectedOptions: {
  36. packageManager: PackageManager.MAVEN,
  37. },
  38. });
  39. // Renders main headings
  40. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  41. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  42. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  43. // Renders SDK version from registry
  44. expect(
  45. await screen.findByText(
  46. textWithMarkupMatcher(
  47. /<artifactId>sentry-spring-boot-starter-jakarta<\/artifactId>\s*<version>2\.99\.9<\/version>/m
  48. )
  49. )
  50. ).toBeInTheDocument();
  51. expect(
  52. await screen.findByText(
  53. textWithMarkupMatcher(
  54. /<artifactId>sentry-maven-plugin<\/artifactId>\s*<version>3\.99\.9<\/version>/m
  55. )
  56. )
  57. ).toBeInTheDocument();
  58. });
  59. it('renders maven with spring boot 2 docs correctly', async function () {
  60. renderWithOnboardingLayout(docs, {
  61. releaseRegistry: {
  62. 'sentry.java.spring-boot': {
  63. version: '2.99.9',
  64. },
  65. 'sentry.java.mavenplugin': {
  66. version: '3.99.9',
  67. },
  68. },
  69. selectedOptions: {
  70. packageManager: PackageManager.MAVEN,
  71. springBootVersion: SpringBootVersion.V2,
  72. },
  73. });
  74. // Renders main headings
  75. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  76. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  77. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  78. // Renders SDK version from registry
  79. expect(
  80. await screen.findByText(
  81. textWithMarkupMatcher(
  82. /<artifactId>sentry-spring-boot-starter<\/artifactId>\s*<version>2\.99\.9<\/version>/m
  83. )
  84. )
  85. ).toBeInTheDocument();
  86. expect(
  87. await screen.findByText(
  88. textWithMarkupMatcher(
  89. /<artifactId>sentry-maven-plugin<\/artifactId>\s*<version>3\.99\.9<\/version>/m
  90. )
  91. )
  92. ).toBeInTheDocument();
  93. });
  94. });