routerContextFixture.tsx 832 B

123456789101112131415161718192021222324252627
  1. import {object as propTypesObject} from 'prop-types';
  2. import {LocationFixture} from 'sentry-fixture/locationFixture';
  3. import {Organization} from 'sentry-fixture/organization';
  4. import {Project} 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: Organization(),
  12. project: Project(),
  13. ...context,
  14. },
  15. childContextTypes: {
  16. router: propTypesObject,
  17. location: propTypesObject,
  18. organization: propTypesObject,
  19. project: propTypesObject,
  20. ...childContextTypes,
  21. },
  22. };
  23. }
  24. // TODO(epurkhiser): Remove once removed from getsentry
  25. export default RouterContextFixture;