echo.spec.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
  2. import {screen} from 'sentry-test/reactTestingLibrary';
  3. import {textWithMarkupMatcher} from 'sentry-test/utils';
  4. import {ProductSolution} from 'sentry/components/onboarding/productSelection';
  5. import docs from './echo';
  6. describe('echo onboarding docs', function () {
  7. it('renders errors onboarding docs correctly', function () {
  8. renderWithOnboardingLayout(docs);
  9. // Renders main headings
  10. expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
  11. expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
  12. expect(screen.getByRole('heading', {name: 'Usage'})).toBeInTheDocument();
  13. });
  14. it('renders performance onboarding docs correctly', async function () {
  15. renderWithOnboardingLayout(docs, {
  16. selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
  17. });
  18. const elements = await screen.findAllByText(
  19. textWithMarkupMatcher(/TracesSampleRate/)
  20. );
  21. for (const element of elements) {
  22. expect(element).toBeInTheDocument();
  23. }
  24. });
  25. });