import React from 'react';
import { render } from '~/testUtils/helpers';
import { IconButton } from '..';
import { icons } from '~/index';

describe('<IconButton />', () => {
  it('matches a snapshot', () => {
    const {
      container: {
        children: [iconButtonEl],
      },
    } = render(<IconButton Asset={icons.SvgPlus} />);

    expect(iconButtonEl).toMatchSnapshot();
  });

  it('renders and svg inside', () => {
    const {
      container: {
        children: [iconButtonEl],
      },
    } = render(<IconButton Asset={icons.SvgPlus} />);

    expect(iconButtonEl.querySelector('svg')).toBeTruthy();
  });
});
