"use strict";

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

var _enzyme = require("enzyme");

var _Picker = require("../Picker");

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

describe('Picker Specs', function () {
  it('should render selected child wrapped with <PickerItem/>', function () {
    var picker = (0, _enzyme.mount)(_react.default.createElement(_Picker.Picker, {
      value: 1
    }, [1, 2, 3, 4]));
    var expected = '2';
    var actual = picker.find('PickerItem').text();
    expect(actual).to.equal(expected);
  });
  it('should set the max of <Picker> to be one less than the number of children', function () {
    var picker = (0, _enzyme.mount)(_react.default.createElement(_Picker.Picker, {
      value: 1
    }, [1, 2, 3, 4]));
    var expected = 3;
    var actual = picker.find('Picker').last().prop('max');
    expect(actual).to.equal(expected);
  });
  it('should be disabled when empty', function () {
    var picker = (0, _enzyme.shallow)(_react.default.createElement(_Picker.PickerBase, null, []));
    var actual = picker.find('SpottablePicker').last().prop('disabled');
    expect(actual).to.be.true();
  });
});