/*
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.
*/
import React from 'react';
import { shallow } from 'enzyme';
import { StyledRoot, StyledControlContainer, StyledValueContainer, StyledPlaceholder, StyledSingleValue, StyledInputContainer, StyledInput, StyledInputSizer, StyledSelectArrow, StyledClearIcon, StyledSearchIcon, StyledOptionContent } from '../index.js';
import { TYPE, SIZE } from '../constants.js';
var styledComponents = [[StyledRoot, 'StyledRoot'], [StyledControlContainer, 'StyledControlContainer'], [StyledValueContainer, 'StyledValueContainer'], [StyledPlaceholder, 'StyledPlaceholder'], [StyledSingleValue, 'StyledSingleValue'], [StyledInputContainer, 'StyledInputContainer'], [StyledInput, 'StyledInput'], [StyledInputSizer, 'StyledInputSizer'], [StyledSelectArrow, 'StyledSelectArrow'], [StyledClearIcon, 'StyledClearIcon'], [StyledSearchIcon, 'StyledSearchIcon'], [StyledOptionContent, 'StyledOptionContent']];
describe('Select styled components', function () {
  test.each(styledComponents)('Basic render', function (Component, name) {
    var component = shallow(React.createElement(Component, null));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has correct default styles"));
  });
  test.each(styledComponents)('Basic render', function (Component, name) {
    var component = shallow(React.createElement(Component, {
      $size: 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 = shallow(React.createElement(Component, {
      $type: 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 = shallow(React.createElement(Component, {
      $disabled: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot("".concat(name, " has correct styles for the disabled state"));
  });
  test('StyledOptionContent styles', function () {
    var component = shallow(React.createElement(StyledOptionContent, {
      $selected: true
    }));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledOptionContent has correct styles when selected');
  });
});