withLatestContext.tsx 450 B

12345678910111213141516171819
  1. import {Component} from 'react';
  2. declare const TestStubs;
  3. const MOCK_ORG = TestStubs.Organization();
  4. const DEFAULTS = {
  5. organization: MOCK_ORG,
  6. organizations: [MOCK_ORG],
  7. project: TestStubs.Project(),
  8. };
  9. const withLatestContextMock = WrappedComponent =>
  10. class WithLatestContextMockWrapper extends Component {
  11. render() {
  12. return <WrappedComponent {...DEFAULTS} {...this.props} />;
  13. }
  14. };
  15. export default withLatestContextMock;