/*
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.
*/
import React from 'react';
import { shallow } from 'enzyme';
import { StyledRoot, StyledLabel, StyledRadioMarkInner, StyledRadioMarkOuter, StyledInput, StyledRadioGroupRoot } from '../index.js';
describe('RadioGroup styled components', function () {
  describe('StyledLabel', function () {
    test.each([[''], ['disabled'], ['$isError']])('', function (prop) {
      var props = {};
      props[prop] = true;
      var component = shallow(React.createElement(StyledLabel, props, React.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when ' + prop);
    });
  });
  describe('StyledLabel', function () {
    test('Label', function () {
      var component = shallow(React.createElement(StyledLabel, null, React.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 = shallow(React.createElement(StyledRadioGroupRoot, null, React.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 = shallow(React.createElement(StyledRadioMarkInner, props, React.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when ' + prop);
    });
  });
  describe('StyledRadioMarkOuter', function () {
    test('', function () {
      var component = shallow(React.createElement(StyledRadioMarkOuter, null, React.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledRadioMarkOuter has correct styles');
    });
  });
  describe('StyledInput', function () {
    test('', function () {
      var component = shallow(React.createElement(StyledInput, null, React.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('StyledInput has correct styles');
    });
  });
  describe('StyledRoot', function () {
    test('', function () {
      var component = shallow(React.createElement(StyledRoot, null, React.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 = shallow(React.createElement(StyledRoot, props, React.createElement("div", null)));
      expect(component.instance().getStyles()).toMatchSnapshot('has correct styles when label is placed' + prop);
    });
  });
});