"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('Icon styled components', function () {
  test('Svg has correct default styles', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.Svg, null));
    expect(wrapper.instance().getStyles()).toMatchSnapshot('Svg basic render');
  });
  test('Svg handles color override', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.Svg, {
      $color: "purple"
    }));
    expect(wrapper.instance().getStyles()).toHaveProperty('fill', 'purple');
  });
  test('Svg handles size via theme constant', function () {
    var wrapper = (0, _enzyme.shallow)(_react.default.createElement(_styledComponents.Svg, {
      $size: "scale400"
    }));
    var styles = wrapper.instance().getStyles();
    expect(styles).toHaveProperty('width', '$theme.sizing.scale400');
    expect(styles).toHaveProperty('height', '$theme.sizing.scale400');
  });
});