Skip to content

Commit 13fa062

Browse files
authored
test(onboarding): Migrate onboarding tests from deprecated mocks to router config (#102728)
this render function is shared with 90+ test suites
1 parent 0f11561 commit 13fa062

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

tests/js/sentry-test/onboarding/renderWithOnboardingLayout.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import {OrganizationFixture} from 'sentry-fixture/organization';
2+
import {ProjectFixture} from 'sentry-fixture/project';
13
import {ProjectKeysFixture} from 'sentry-fixture/projectKeys';
24

3-
import {initializeOrg} from 'sentry-test/initializeOrg';
4-
import {render} from 'sentry-test/reactTestingLibrary';
5+
import {render, type RouterConfig} from 'sentry-test/reactTestingLibrary';
56

67
import {OnboardingLayout} from 'sentry/components/onboarding/gettingStartedDoc/onboardingLayout';
78
import type {
@@ -41,14 +42,16 @@ export function renderWithOnboardingLayout<
4142
selectedOptions = {},
4243
} = options;
4344

44-
const {organization, project, router} = initializeOrg({
45-
organization: renderOptions.organization,
46-
router: {
47-
location: {
48-
query: selectedOptions,
49-
},
45+
const organization = OrganizationFixture(renderOptions.organization);
46+
const project = ProjectFixture({organization});
47+
48+
const initialRouterConfig: RouterConfig = {
49+
location: {
50+
pathname: `/organizations/${organization.slug}/projects/${project.slug}/getting-started/`,
51+
query: selectedOptions,
5052
},
51-
});
53+
route: `/organizations/:orgId/projects/:projectId/getting-started/`,
54+
};
5255

5356
const projectKey = 'test-project-key-id';
5457

@@ -87,8 +90,7 @@ export function renderWithOnboardingLayout<
8790
/>,
8891
{
8992
organization,
90-
router,
91-
deprecatedRouterMocks: true,
93+
initialRouterConfig,
9294
}
9395
);
9496
}

0 commit comments

Comments
 (0)