"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('RadioGroup 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('StyledRadioGroupRoot', function () {
    test('RadioGroupRoot', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRadioGroupRoot, null, _react.default.createElement("div", null)));
      ['horizontal', 'vertical'].forEach(function (align) {
        component.setProps({
          $align: align
        });
        expect(component.instance().getStyles()).toMatchSnapshot('StyledRadioGroupRoot has correct styles when set to ' + align);
      });
    });
  });
  describe('StyledRadioMarkInner', function () {
    test.each([[''], ['disabled'], ['$isFocused'], ['checked'], ['$isError']])('', function (prop) {
      var props = {};
      props[prop] = true;
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRadioMarkInner, props, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when ' + prop);
    });
  });
  describe('StyledRadioMarkOuter', function () {
    test('', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_index.StyledRadioMarkOuter, null, _react.default.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledRadioMarkOuter has correct styles');
    });
  });
  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);
    });
  });
});