1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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/productSelection';
- import docs from './apple-macos';
- describe('apple-macos onboarding docs', function () {
- it('renders docs correctly', async function () {
- renderWithOnboardingLayout(docs, {
- releaseRegistry: {
- 'sentry.cocoa': {
- version: '1.99.9',
- },
- },
- });
- // Renders main headings
- expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
- expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
- expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();
- // Renders SDK version from registry
- expect(
- await screen.findByText(
- textWithMarkupMatcher(
- /\.package\(url: "https:\/\/github.com\/getsentry\/sentry-cocoa", from: "1\.99\.9"\),/
- )
- )
- ).toBeInTheDocument();
- });
- it('renders performance onboarding docs correctly', async function () {
- renderWithOnboardingLayout(docs, {
- selectedProducts: [ProductSolution.PERFORMANCE_MONITORING],
- });
- expect(
- await screen.findAllByText(textWithMarkupMatcher(/options.tracesSampleRate/))
- ).toHaveLength(2);
- });
- it('renders profiling onboarding docs correctly', async function () {
- renderWithOnboardingLayout(docs, {
- selectedProducts: [
- ProductSolution.PERFORMANCE_MONITORING,
- ProductSolution.PROFILING,
- ],
- });
- expect(
- await screen.findAllByText(textWithMarkupMatcher(/options.profilesSampleRate/))
- ).toHaveLength(2);
- });
- });
|