import React from 'react';
import { shallow } from 'enzyme';
import { Icon as fromLib } from '../../..';
import Icon from '..';
var props = {
  name: 'test text'
};
var wrapper;
describe('Icon', function () {
  beforeEach(function () {
    wrapper = shallow(React.createElement(Icon, props));
  });
  it('should be exported as part of the library', function () {
    expect(fromLib).toEqual(Icon);
  });
  it('should render correctly', function () {
    expect(wrapper).toMatchSnapshot();
  });
  it('should attach classNames', function () {
    wrapper.setProps({
      className: 'textClass'
    });
    var className = wrapper.prop('className');
    expect(className).toMatch(/textClass/);
  });
  it('should allow different tags', function () {
    wrapper.setProps({
      tag: 'a'
    });
    expect(wrapper.find('a').length).toBe(1);
  });
  it('should pass additional props', function () {
    wrapper.setProps({
      id: 'testId'
    });
    expect(wrapper.prop('id')).toBe('testId');
  });
});