"use strict";

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

var _enzyme = require("enzyme");

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

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('Checkbox styled components', function () {
  describe('StyledLabel', function () {
    test.each([[''], ['disabled'], ['$isError']])('', function (prop) {
      var props = {};
      props[prop] = true;
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledLabel, props, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when ' + prop);
    });
  });
  describe('StyledLabel', function () {
    test('Label', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledLabel, null, _react.default.createElement("div", null)));
      ['left', 'right', 'top', 'bottom'].forEach(function (labelPlacement) {
        component.setProps({
          $labelPlacement: labelPlacement
        });
        expect(component.instance().getStyles()).toMatchSnapshot('StyledLabel has correct styles when set to ' + labelPlacement);
      });
    });
  });
  describe('StyledCheckmark', function () {
    test.each([[''], ['$disabled'], ['$disabled', '$checked'], ['$isIndeterminate'], ['$isFocused'], ['$isActive'], ['$isHovered'], ['$checked'], ['$checked', '$isHovered'], ['$checked', '$isActive'], ['$checked', '$isFocused'], ['$isError'], ['$isError', '$checked'], ['$isError', '$checked', '$isHovered'], ['$isError', '$checked', '$isActive'], ['$isError', '$checked', '$isFocused'], ['$isError', '$isHovered'], ['$isError', '$isActive'], ['$isError', '$isFocused']])('', function () {
      var passedProps = {};

      for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
        props[_key] = arguments[_key];
      }

      props.map(function (prop) {
        passedProps[prop] = true;
      });
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledCheckmark, passedProps, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when ' + props.join(' '));
    });
  });
  describe('StyledInput', function () {
    test('', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledInput, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledInput has correct styles');
    });
  });
  describe('StyledRoot', function () {
    test('', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRoot, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledRoot has correct styles');
    });
    test.each([['top'], ['bottom'], ['left'], ['right']])('', function (prop) {
      var props = {
        $labelPlacement: prop
      };
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRoot, props, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when label is placed' + prop);
    });
  });
});