"use strict";

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

var _ExpandableList = require("../ExpandableList");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

describe('ExpandableList', function () {
  describe('#aria-multiselectable', function () {
    it('should be true when select is multiple', function () {
      var expandableList = (0, _enzyme.mount)(_react.default.createElement(_ExpandableList.ExpandableListBase, {
        title: "Item",
        select: "multiple"
      }, ['option1', 'option2', 'option3']));
      var expected = true;
      var actual = expandableList.find('ExpandableItem').prop('aria-multiselectable');
      expect(actual).to.equal(expected);
    });
  });
  it('should update when children are added', function () {
    var children = ['option1', 'option2', 'option3'];
    var expandableList = (0, _enzyme.mount)(_react.default.createElement(_ExpandableList.ExpandableListBase, {
      title: "Item",
      open: true
    }, children));
    var updatedChildren = children.concat('option4', 'option5');
    expandableList.setProps({
      children: updatedChildren
    });
    var expected = 5;
    var actual = expandableList.find('GroupItem').length;
    expect(actual).to.equal(expected);
  });
});