nextjs.spec.tsx 823 B

12345678910111213141516171819202122232425262728293031
  1. import {Organization} from 'sentry-fixture/organization';
  2. import {render, screen} from 'sentry-test/reactTestingLibrary';
  3. import {StepTitle} from 'sentry/components/onboarding/gettingStartedDoc/step';
  4. import {GettingStartedWithNextJs, steps} from './nextjs';
  5. describe('GettingStartedWithNextJs', function () {
  6. const organization = Organization();
  7. it('renders doc correctly', function () {
  8. render(
  9. <GettingStartedWithNextJs
  10. dsn="test-dsn"
  11. projectSlug="test-project"
  12. organization={organization}
  13. />
  14. );
  15. // Steps
  16. for (const step of steps({
  17. dsn: 'test-dsn',
  18. projectSlug: 'test-project',
  19. organization,
  20. })) {
  21. expect(
  22. screen.getByRole('heading', {name: step.title ?? StepTitle[step.type]})
  23. ).toBeInTheDocument();
  24. }
  25. });
  26. });