ember.spec.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 {GettingStartedWithEmber, nextSteps, steps} from './ember';
  5. describe('GettingStartedWithEmber', function () {
  6. it('all products are selected', function () {
  7. render(
  8. <GettingStartedWithEmber
  9. dsn="test-dsn"
  10. activeProductSelection={[
  11. ProductSolution.PERFORMANCE_MONITORING,
  12. ProductSolution.SESSION_REPLAY,
  13. ]}
  14. />
  15. );
  16. // Steps
  17. for (const step of steps()) {
  18. expect(
  19. screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
  20. ).toBeInTheDocument();
  21. }
  22. // Next Steps
  23. const filteredNextStepsLinks = nextSteps.filter(
  24. nextStep =>
  25. ![
  26. ProductSolution.PERFORMANCE_MONITORING,
  27. ProductSolution.SESSION_REPLAY,
  28. ].includes(nextStep.id as ProductSolution)
  29. );
  30. for (const filteredNextStepsLink of filteredNextStepsLinks) {
  31. expect(
  32. screen.getByRole('link', {name: filteredNextStepsLink.name})
  33. ).toBeInTheDocument();
  34. }
  35. });
  36. });