"use strict";

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

var _enzyme = require("enzyme");

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

var _index2 = require("../../themes/index.js");

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

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.
*/
test('Input - StyledRoot - basic render', function () {
  var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRoot, {
    $size: _index.SIZE.default
  }, _react.default.createElement("span", null)));
  expect(component.instance().getStyles()).toMatchSnapshot('StyledRoot has correct default styles');
  component.setProps({
    $size: _index.SIZE.compact
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledRoot has correct styles when compact');
});
test('Input - StyledInputEnhancer - basic render', function () {
  var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledInputEnhancer, {
    $size: _index.SIZE.default,
    $position: _constants.ENHANCER_POSITION.start
  }, _react.default.createElement("span", null)));
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputEnhancer has correct styles when default size and start position');
  component.setProps({
    $size: _index.SIZE.compact,
    $position: _constants.ENHANCER_POSITION.end
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputEnhancer has correct styles when compact and end position');
});
test('Input - StyledInputContainer - basic render', function () {
  var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledInputContainer, {
    $size: _index.SIZE.default,
    $adjoined: _index.ADJOINED.none
  }, _react.default.createElement("span", null)));
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct default styles');
  component.setProps({
    $isFocused: true
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when focused');
  component.setProps({
    $size: _index.SIZE.compact
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when compact');
  component.setProps({
    $adjoined: _index.ADJOINED.left
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when has start enhancer');
  component.setProps({
    $adjoined: _index.ADJOINED.right
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when has end enhancer');
  component.setProps({
    $adjoined: _index.ADJOINED.both
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when has start and end enhancers');
  component.setProps({
    $error: true
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when error');
  component.setProps({
    $disabled: true
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when disabled');
  component.setProps({
    $theme: (0, _index2.createTheme)(_index2.lightThemePrimitives, {
      borders: {
        useRoundedCorners: false
      }
    })
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInputContainer has correct styles when useRoundedCorners is false');
});
test('Input - StyledInput - basic render', function () {
  var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledInput, {
    $size: _index.SIZE.default
  }));
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInput has correct default styles');
  component.setProps({
    $size: _index.SIZE.compact,
    $disabled: true
  });
  expect(component.instance().getStyles()).toMatchSnapshot('StyledInput has correct styles when compact and disabled');
});