12345678910111213141516171819202122232425262728293031323334353637383940 |
- import {renderWithOnboardingLayout} from 'sentry-test/onboarding/renderWithOnboardingLayout';
- import {screen} from 'sentry-test/reactTestingLibrary';
- import {textWithMarkupMatcher} from 'sentry-test/utils';
- import {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types';
- import docs from './cloudflare-pages';
- describe('express onboarding docs', function () {
- it('renders onboarding docs correctly', () => {
- renderWithOnboardingLayout(docs);
- // Renders main headings
- expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
- expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
- expect(screen.getByRole('heading', {name: 'Upload Source Maps'})).toBeInTheDocument();
- // Includes import statement
- const allMatches = screen.getAllByText(
- textWithMarkupMatcher(/import \* as Sentry from "@sentry\/cloudflare"/)
- );
- allMatches.forEach(match => {
- expect(match).toBeInTheDocument();
- });
- });
- it('displays sample rates by default', () => {
- renderWithOnboardingLayout(docs, {
- selectedProducts: [
- ProductSolution.ERROR_MONITORING,
- ProductSolution.PERFORMANCE_MONITORING,
- ProductSolution.PROFILING,
- ],
- });
- expect(
- screen.getByText(textWithMarkupMatcher(/tracesSampleRate/))
- ).toBeInTheDocument();
- });
- });
|