unity.spec.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {ProjectFixture} from 'sentry-fixture/project';
  2. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  3. import {screen} from 'sentry-test/reactTestingLibrary';
  4. import {textWithMarkupMatcher} from 'sentry-test/utils';
  5. import docs from './unity';
  6. function renderMockRequests() {
  7. MockApiClient.addMockResponse({
  8. url: '/projects/org-slug/project-slug/',
  9. body: [ProjectFixture()],
  10. });
  11. }
  12. describe('unity onboarding docs', function () {
  13. it('renders docs correctly', async function () {
  14. renderMockRequests();
  15. renderWithOnboardingLayout(docs, {
  16. releaseRegistry: {
  17. 'sentry.dotnet.unity': {
  18. version: '1.99.9',
  19. },
  20. },
  21. });
  22. // Renders main headings
  23. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  24. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  25. expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
  26. expect(screen.getByRole('heading', {name: 'Troubleshooting'})).toBeInTheDocument();
  27. // Renders SDK version from registry
  28. expect(
  29. await screen.findByText(
  30. textWithMarkupMatcher(/https:\/\/github.com\/getsentry\/unity\.git#1\.99\.9/)
  31. )
  32. ).toBeInTheDocument();
  33. });
  34. });