routerContextFixture.tsx 766 B

123456789101112131415161718192021222324
  1. import {object as propTypesObject} from 'prop-types';
  2. import {LocationFixture} from 'sentry-fixture/locationFixture';
  3. import {OrganizationFixture} from 'sentry-fixture/organization';
  4. import {ProjectFixture} from 'sentry-fixture/project';
  5. import {RouterFixture} from 'sentry-fixture/routerFixture';
  6. export function RouterContextFixture([context, childContextTypes] = []) {
  7. return {
  8. context: {
  9. location: LocationFixture(),
  10. router: RouterFixture(),
  11. organization: OrganizationFixture(),
  12. project: ProjectFixture(),
  13. ...context,
  14. },
  15. childContextTypes: {
  16. router: propTypesObject,
  17. location: propTypesObject,
  18. organization: propTypesObject,
  19. project: propTypesObject,
  20. ...childContextTypes,
  21. },
  22. };
  23. }