gcpfunctions.spec.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 from './gcpfunctions';
  5. describe('gcpfunctions onboarding docs', function () {
  6. it('renders docs correctly', async function () {
  7. renderWithOnboardingLayout(docs, {
  8. releaseRegistry: {
  9. 'sentry.dotnet.google-cloud-function': {
  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. expect(screen.getByRole('heading', {name: 'Samples'})).toBeInTheDocument();
  19. // Renders SDK version from registry
  20. expect(
  21. await screen.findByText(
  22. textWithMarkupMatcher(
  23. /Install-Package Sentry.Google.Cloud.Functions -Version 1\.99\.9/
  24. )
  25. )
  26. ).toBeInTheDocument();
  27. expect(
  28. await screen.findByText(
  29. textWithMarkupMatcher(
  30. /<PackageReference Include="Sentry\.Google\.Cloud\.Functions" Version="1\.99\.9"\/>/
  31. )
  32. )
  33. ).toBeInTheDocument();
  34. });
  35. });