"use strict";

var _jsxRuntime = require("react/jsx-runtime");

var _enzyme = require("enzyme");

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

describe('Picker Specs', function () {
  test('should render selected child wrapped with <PickerItem/>', function () {
    var picker = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Picker.Picker, {
      value: 1,
      children: [1, 2, 3, 4]
    }));
    var expected = '2';
    var actual = picker.find('PickerItem').at(1).text();
    expect(actual).toBe(expected);
  });
  test('should set the max of <Picker> to be one less than the number of children', function () {
    var picker = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Picker.Picker, {
      value: 1,
      children: [1, 2, 3, 4]
    }));
    var expected = 3;
    var actual = picker.find('Picker').last().prop('max');
    expect(actual).toBe(expected);
  });
  test('should be disabled when empty', function () {
    var picker = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Picker.PickerBase, {
      children: []
    }));
    var actual = picker.find('Picker').last().prop('disabled');
    expect(actual).toBe(true);
  });
});