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 },
    } = render(<IconButton Asset={icons.SvgPlus} />);

    const iconButtonEl = children[0];

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

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

    const iconButtonEl = children[0];

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