mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
26 lines
859 B
TypeScript
26 lines
859 B
TypeScript
import {LocationFixture} from 'sentry-fixture/locationFixture';
|
|
import {OrganizationFixture} from 'sentry-fixture/organization';
|
|
import {ProjectFixture} from 'sentry-fixture/project';
|
|
import {RouterFixture} from 'sentry-fixture/routerFixture';
|
|
|
|
import {SentryPropTypeValidators} from 'sentry/sentryPropTypeValidators';
|
|
|
|
export function RouterContextFixture([context, childContextTypes] = []) {
|
|
return {
|
|
context: {
|
|
location: LocationFixture(),
|
|
router: RouterFixture(),
|
|
organization: OrganizationFixture(),
|
|
project: ProjectFixture(),
|
|
...context,
|
|
},
|
|
childContextTypes: {
|
|
router: SentryPropTypeValidators.isObject,
|
|
location: SentryPropTypeValidators.isObject,
|
|
organization: SentryPropTypeValidators.isObject,
|
|
project: SentryPropTypeValidators.isObject,
|
|
...childContextTypes,
|
|
},
|
|
};
|
|
}
|