import * as React from 'react';
import { shallow } from 'enzyme';

function _extends() {
  _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];

      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }

    return target;
  };

  return _extends.apply(this, arguments);
}

function shallowChild(Component, defaultProps = {}, nestLevel) {
  return function innerRender(props = {}) {
    let rendered = shallow( /*#__PURE__*/React.createElement(Component, _extends({}, defaultProps, props)));

    if (nestLevel) {
      let repeat = nestLevel;

      while (repeat--) {
        rendered = rendered.first().shallow();
      }
    }

    return rendered;
  };
}

export { shallowChild };
//# sourceMappingURL=index.js.map
