javascript.spec.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 GettingStartedWithJavaScript, {nextSteps, steps} from './javascript';
  5. describe('GettingStartedWithJavaScript', function () {
  6. it('all products are selected', function () {
  7. const {container} = render(
  8. <GettingStartedWithJavaScript
  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. expect(container).toSnapshot();
  36. });
  37. });