text: "use strict";
  
  var _getFormValues = _interopRequireDefault(require("../getFormValues"));
  
  var _plain = _interopRequireDefault(require("../../structure/plain"));
  
  var _expectations = _interopRequireDefault(require("../../structure/plain/__tests__/expectations"));
  
  var _immutable = _interopRequireDefault(require("../../structure/immutable"));
  
  var _expectations2 = _interopRequireDefault(require("../../structure/immutable/__tests__/expectations"));
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  var describeGetFormValues = function describeGetFormValues(name, structure, setup) {
    var getFormValues = (0, _getFormValues.default)(structure);
    var fromJS = structure.fromJS,
        getIn = structure.getIn;
    describe(name, function () {
      beforeAll(function () {
        setup();
      });
      it('should return a function', function () {
        expect(typeof getFormValues('foo')).toBe('function');
      });
      it('should get the form values from state', function () {
        expect(getFormValues('foo')(fromJS({
          form: {
            foo: {
              values: {
                dog: 'Snoopy',
                cat: 'Garfield'
              }
            }
          }
        }))).toEqualMap({
          dog: 'Snoopy',
          cat: 'Garfield'
        });
      });
      it('should use getFormState if provided', function () {
        expect(getFormValues('foo', function (state) {
          return getIn(state, 'someOtherSlice');
        })(fromJS({
          someOtherSlice: {
            foo: {
              values: {
                dog: 'Snoopy',
                cat: 'Garfield'
              }
            }
          }
        }))).toEqualMap({
          dog: 'Snoopy',
          cat: 'Garfield'
        });
      });
    });
  };
  
  describeGetFormValues('getFormValues.plain', _plain.default, function () {
    return expect.extend(_expectations.default);
  });
  describeGetFormValues('getFormValues.immutable', _immutable.default, function () {
    return expect.extend(_expectations2.default);
  });