"use strict";

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

var _immutable = require("immutable");

var _features = _interopRequireDefault(require("../features"));

var _features2 = require("../../actions/features");

describe('features reducer', function () {
  it('properly adds features to the set', function () {
    var initialState = (0, _immutable.Set)();
    var exampleFeature = 'feat2';
    var featuresList = ['feat1', exampleFeature, 'feat3'];
    var action = (0, _features2.addFeatures)(featuresList);
    var nextState = (0, _features.default)(initialState, action);
    expect(nextState.includes(exampleFeature)).to.be.true();
  });
  it('properly removes features from the set', function () {
    var initialState = (0, _immutable.Set)(['feat1', 'feat2', 'feat3']);
    var featuresToRemove = ['feat2', 'feat3'];
    var action = (0, _features2.removeFeatures)(featuresToRemove);
    var nextState = (0, _features.default)(initialState, action);
    expect(nextState.includes('feat2')).to.be.false();
    expect(nextState.includes('feat1')).to.be.true();
  });
});