angular.spec.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import {render, screen} from 'sentry-test/reactTestingLibrary';
  2. import {StepTitle} from 'sentry/components/onboarding/gettingStartedDoc/step';
  3. import {ProductSolution} from 'sentry/components/onboarding/productSelection';
  4. import {AngularVersion, GettingStartedWithAngular, nextSteps, steps} from './angular';
  5. describe('GettingStartedWithAngular', function () {
  6. it('all products are selected', function () {
  7. render(
  8. <GettingStartedWithAngular
  9. dsn="test-dsn"
  10. projectSlug="test-project"
  11. activeProductSelection={[
  12. ProductSolution.PERFORMANCE_MONITORING,
  13. ProductSolution.SESSION_REPLAY,
  14. ]}
  15. />
  16. );
  17. // Steps
  18. for (const step of steps({
  19. angularVersion: AngularVersion.V12,
  20. errorHandlerProviders: 'test-error-handler-providers',
  21. sentryInitContent: 'test-init-content',
  22. })) {
  23. expect(
  24. screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
  25. ).toBeInTheDocument();
  26. }
  27. // Next Steps
  28. const filteredNextStepsLinks = nextSteps.filter(
  29. nextStep =>
  30. ![
  31. ProductSolution.PERFORMANCE_MONITORING,
  32. ProductSolution.SESSION_REPLAY,
  33. ].includes(nextStep.id as ProductSolution)
  34. );
  35. for (const filteredNextStepsLink of filteredNextStepsLinks) {
  36. expect(
  37. screen.getByRole('link', {name: filteredNextStepsLink.name})
  38. ).toBeInTheDocument();
  39. }
  40. });
  41. });