"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 }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

describe('StyledComponents', function () {
  describe('StyledRoot', function () {
    it('displays correct styles by default', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.StyledRoot, null));
      expect(component.instance().getStyles()).toMatchSnapshot();
    });
  });
  describe('StyledStar', function () {
    it('displays correct styles by default', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.StyledStar, null));
      expect(component.instance().getStyles()).toMatchSnapshot();
    });
    it.each([['$isActive'], ['$isSelected']])('displays correct styling with state %s', function (stateProp) {
      var props = _defineProperty({}, "".concat(stateProp), true);

      var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.StyledStar, props));
      expect(component.instance().getStyles()).toMatchSnapshot();
    });
  });
  describe('StyledEmoticon', function () {
    it('displays correct styles by default', function () {
      var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.StyledEmoticon, {
        $index: 1
      }));
      expect(component.instance().getStyles()).toMatchSnapshot();
    });
    it.each([['$isActive'], ['$isSelected']])('displays correct styling with state %s', function (stateProp) {
      var _props2;

      var props = (_props2 = {}, _defineProperty(_props2, "".concat(stateProp), true), _defineProperty(_props2, "$index", 1), _props2);
      var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.StyledEmoticon, props));
      expect(component.instance().getStyles()).toMatchSnapshot();
    });
    describe('EmoticonStates', function () {
      it.each([[1], [2], [3], [4], [5]])('displays correct SVG icon with $index=%d', function ($index) {
        var component = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.StyledEmoticon, {
          $index: $index
        }));
        expect(component.instance().getStyles()).toMatchSnapshot();
      });
    });
  });
});