"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _chai = require("chai");

var _immutable = require("immutable");

var _values = _interopRequireDefault(require("lodash/values"));

var _valMap = _interopRequireDefault(require("../valMap"));

describe('valMap', function () {
  it('applies the given function to the values of a hash without mutation', function () {
    var someHash = {
      1: 'a',
      2: 'b',
      3: 'c'
    };

    var testFn = function testFn(s) {
      return s.toUpperCase();
    };

    var mappedHash = (0, _valMap.default)(someHash, testFn);
    var mappedVals = (0, _values.default)(mappedHash); // check for function application

    (0, _chai.expect)((0, _immutable.fromJS)(mappedVals)).to.be.deep.equal((0, _immutable.fromJS)(['A', 'B', 'C'])); // check for no mutation

    var originalVals = (0, _values.default)(someHash);
    (0, _chai.expect)((0, _immutable.fromJS)(originalVals)).to.be.deep.equal((0, _immutable.fromJS)(['a', 'b', 'c']));
  });
});