import { jsx as ___EmotionJSX } from "@emotion/core";
import React from 'react';
import { shallow } from 'enzyme';
import renderer from 'react-test-renderer';
import CameraIcon from '../../../../svgs/icons/camera-icon.svg';
import RoundButton from './index';
describe('<RoundButton />', function () {
  describe('UI snapshots', function () {
    it('renders with props', function () {
      var tree = renderer.create(___EmotionJSX(RoundButton, {
        disabled: true,
        onClick: function onClick() {},
        icon: ___EmotionJSX(CameraIcon, null)
      }, "Button Text")).toJSON();
      expect(tree).toMatchSnapshot();
    });
  });
  describe('onClick callback', function () {
    it('should be invoked onClick', function () {
      var spy = jest.fn();
      var button = shallow(___EmotionJSX(RoundButton, {
        onClick: spy,
        icon: ___EmotionJSX(CameraIcon, null)
      }, "Button Text"));
      button.simulate('click');
      expect(spy).toHaveBeenCalled();
    });
    it('should not be invoked if disabled', function () {
      var spy = jest.fn();
      var button = shallow(___EmotionJSX(RoundButton, {
        disabled: true,
        onClick: spy,
        icon: ___EmotionJSX(CameraIcon, null)
      }, "Button Text"));
      button.simulate('click');
      expect(spy).not.toHaveBeenCalled();
    });
    it('should not be invoked if loading', function () {
      var spy = jest.fn();
      var button = shallow(___EmotionJSX(RoundButton, {
        loading: true,
        onClick: spy,
        icon: ___EmotionJSX(CameraIcon, null)
      }, "Button Text"));
      button.simulate('click');
      expect(spy).not.toHaveBeenCalled();
    });
  });
});