"use strict";

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

var _index = _interopRequireDefault(require("../index"));

var _enzyme = _interopRequireWildcard(require("enzyme"));

var _enzymeAdapterReact = _interopRequireDefault(require("enzyme-adapter-react-16"));

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

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

_enzyme.default.configure({
  adapter: new _enzymeAdapterReact.default()
});

var testOptions = [{
  value: 'value1',
  label: 'Value 1'
}, {
  value: 'value2',
  label: 'Value 2'
}, {
  value: 'value3',
  label: 'Value 3'
}];
describe('CreatableSelect', function () {
  test('should render', function () {
    var wrapper = (0, _enzyme.mount)(_react.default.createElement(_index.default, null));
    expect(wrapper.find(_index.default).length).toEqual(1);
  });
  test('should pass additional arbitrary parameters to react creatable select', function () {
    var shallowWrapper = (0, _enzyme.shallow)(_react.default.createElement(_index.default, {
      options: testOptions,
      className: "additional-classname",
      otherProp: 'another prop'
    }));
    expect(shallowWrapper.find('.vs-default-react-select-creatable').hasClass('additional-classname')).toBe(true);
    expect(shallowWrapper.find('.vs-default-react-select-creatable').prop('otherProp')).toBe('another prop');
  });
});