import {initializeOrg} from 'sentry-test/initializeOrg'; import {render} from 'sentry-test/reactTestingLibrary'; import {OnboardingLayout} from 'sentry/components/onboarding/gettingStartedDoc/onboardingLayout'; import type { BasePlatformOptions, Docs, SelectedPlatformOptions, } from 'sentry/components/onboarding/gettingStartedDoc/types'; import type {ReleaseRegistrySdk} from 'sentry/components/onboarding/gettingStartedDoc/useSourcePackageRegistries'; import {ProductSolution} from 'sentry/components/onboarding/productSelection'; import {DeepPartial} from 'sentry/types/utils'; interface Options { releaseRegistry?: DeepPartial; selectedOptions?: Partial>; selectedProducts?: ProductSolution[]; } export function renderWithOnboardingLayout< PlatformOptions extends BasePlatformOptions = BasePlatformOptions, >(docsConfig: Docs, options: Options = {}) { const { releaseRegistry = {}, selectedProducts = [ ProductSolution.PERFORMANCE_MONITORING, ProductSolution.PROFILING, ProductSolution.SESSION_REPLAY, ], selectedOptions = {}, } = options; const {organization, routerContext} = initializeOrg({ router: { location: { query: selectedOptions, }, }, }); MockApiClient.addMockResponse({ url: `/organizations/${organization.slug}/sdks/`, body: releaseRegistry, }); render( , { organization, context: routerContext, } ); }