gatsby.spec.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 {GettingStartedWithGatsby, nextSteps, steps} from './gatsby';
  5. describe('GettingStartedWithGatsby', function () {
  6. it('all products are selected', function () {
  7. render(
  8. <GettingStartedWithGatsby
  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. expect(
  20. screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
  21. ).toBeInTheDocument();
  22. }
  23. // Next Steps
  24. const filteredNextStepsLinks = nextSteps.filter(
  25. nextStep =>
  26. ![
  27. ProductSolution.PERFORMANCE_MONITORING,
  28. ProductSolution.SESSION_REPLAY,
  29. ].includes(nextStep.id as ProductSolution)
  30. );
  31. for (const filteredNextStepsLink of filteredNextStepsLinks) {
  32. expect(
  33. screen.getByRole('link', {name: filteredNextStepsLink.name})
  34. ).toBeInTheDocument();
  35. }
  36. });
  37. });