"use strict";

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

var _enzyme = require("enzyme");

var _styledComponents = require("../styled-components");

var _input = require("../../input");

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.
*/
describe('Textarea', function () {
  test('TextareaContainer - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.TextareaContainer, {
      $size: _input.SIZE.default
    }, _react.default.createElement("span", null)));
    expect(component.instance().getStyles()).toMatchSnapshot('TextareaContainer has correct default styles');
    component.setProps({
      $isFocused: true
    });
    expect(component.instance().getStyles()).toMatchSnapshot('TextareaContainer has correct styles when focused');
    component.setProps({
      $size: _input.SIZE.compact
    });
    expect(component.instance().getStyles()).toMatchSnapshot('TextareaContainer has correct styles when compact');
    component.setProps({
      $error: true
    });
    expect(component.instance().getStyles()).toMatchSnapshot('TextareaContainer has correct styles when error');
    component.setProps({
      $disabled: true
    });
    expect(component.instance().getStyles()).toMatchSnapshot('TextareaContainer has correct styles when disabled');
  });
  test('Textarea element - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.Textarea, {
      $size: _input.SIZE.default
    }));
    expect(component.instance().getStyles()).toMatchSnapshot('Textarea has correct default styles');
    component.setProps({
      $size: _input.SIZE.compact,
      $disabled: true
    });
    expect(component.instance().getStyles()).toMatchSnapshot('Textarea has correct styles when compact and disabled');
  });
});