"use strict";

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

var _enzyme = require("enzyme");

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

var _constants = require("../constants");

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

/*
Copyright (c) 2018 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
var styledComponents = [[_index.StyledRoot, 'StyledRoot'], [_index.StyledControlContainer, 'StyledControlContainer'], [_index.StyledValueContainer, 'StyledValueContainer'], [_index.StyledPlaceholder, 'StyledPlaceholder'], [_index.StyledSingleValue, 'StyledSingleValue'], [_index.StyledInputContainer, 'StyledInputContainer'], [_index.StyledInput, 'StyledInput'], [_index.StyledInputSizer, 'StyledInputSizer'], [_index.StyledSelectArrow, 'StyledSelectArrow'], [_index.StyledClearIcon, 'StyledClearIcon'], [_index.StyledSearchIcon, 'StyledSearchIcon'], [_index.StyledOptionContent, 'StyledOptionContent']];
describe('Select styled components', function () {
  test.each(styledComponents)('Basic render', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, null));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has correct default styles"));
  });
  test.each(styledComponents)('Basic render', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $size: _constants.SIZE.compact
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has correct styles for the SIZE.compact"));
  });
  test.each(styledComponents)('Basic render', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $type: _constants.TYPE.search
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has correct styles for the TYPE.search"));
  });
  test.each(styledComponents)('Basic render', function (Component, name) {
    var component = (0, _enzyme.shallow)(_react.default.createElement(Component, {
      $disabled: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has correct styles for the disabled state"));
  });
  test('StyledOptionContent styles', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledOptionContent, {
      $selected: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledOptionContent has correct styles when selected');
  });
});