kotlin.spec.tsx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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} from './kotlin';
  5. describe('GettingStartedWithKotlin', 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.maven-plugin': {
  29. version: '3.99.9',
  30. },
  31. },
  32. selectedOptions: {
  33. packageManager: PackageManager.MAVEN,
  34. },
  35. });
  36. // Renders main headings
  37. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  38. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  39. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  40. // Renders Plugin version from registry
  41. expect(
  42. await screen.findByText(
  43. textWithMarkupMatcher(
  44. /<artifactId>sentry-maven-plugin<\/artifactId>\s*<version>3\.99\.9<\/version>/m
  45. )
  46. )
  47. ).toBeInTheDocument();
  48. });
  49. });