"use strict";

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

var _enzyme = require("enzyme");

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

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('FormControl - Label and Caption for controls', function () {
  test('StyledLabel - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.Label, null, "Label"));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledLabel has correct default styles');
    component.setProps({
      $disabled: true
    });
    expect(component.instance().getStyles()).toMatchSnapshot('StyledLabel has correct styles when compact and disabled');
  });
  test('StyledCaption - basic render', function () {
    var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.Caption, null, "Caption"));
    expect(component.instance().getStyles()).toMatchSnapshot('StyledCaption has correct default styles');
    component.setProps({
      $error: true
    });
    expect(component.instance().getStyles()).toMatchSnapshot('StyledCaption has correct styles when compact and error is boolean');
    component.setProps({
      $error: 'Error message'
    });
    expect(component.instance().getStyles()).toMatchSnapshot('StyledCaption has correct styles when error is a string');
  });
});