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