vue.spec.tsx 1.3 KB

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