import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { render } from '@testing-library/react';
import Icon from '../index';

var Right = function Right(props) {
  return /*#__PURE__*/React.createElement("svg", _extends({
    viewBox: "0 0 32 24",
    fill: "currentColor",
    stroke: "currentColor",
    width: "1em",
    height: "1em"
  }, props), /*#__PURE__*/React.createElement("path", {
    d: "M1 12.376l8.8 9.114L30.431 1.568",
    stroke: "currentColor",
    strokeWidth: 2.6,
    fill: "none"
  }));
};

describe('Icon', function () {
  it('renders Icons using iconfont', function () {
    var MyIcon = Icon.createFromIconfont('//lf1-cdn-tos.bytegoofy.com/obj/iconpark/svg_20337_14.627ee457cf7594fbbce6d5e14b8c29ef.js');
    var wrapper = render( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MyIcon, {
      type: "home"
    }), /*#__PURE__*/React.createElement(MyIcon, {
      type: "user"
    })));
    expect(wrapper.asFragment()).toMatchSnapshot();
  });
  it('renders Icons using svg component', function () {
    var wrapper = render( /*#__PURE__*/React.createElement(Icon, {
      size: "lg",
      theme: "primary",
      component: Right
    }));
    expect(wrapper.asFragment()).toMatchSnapshot();
  });
});