import { jsx as ___EmotionJSX } from "@emotion/core";
import React from 'react';
import { shallow } from 'enzyme';
import renderer from 'react-test-renderer';
import LinkButton from './index';
describe('<LinkButton/>', function () {
  describe('UI snapshots', function () {
    it('renders with props', function () {
      var tree = renderer.create(___EmotionJSX(LinkButton, {
        onClick: function onClick() {},
        href: "#"
      }, "Click me!")).toJSON();
      expect(tree).toMatchSnapshot();
    });
  });
  describe('href handling', function () {
    it('should link to a path', function () {
      var wrapper = shallow(___EmotionJSX(LinkButton, {
        href: "/some/path"
      }, "text"));
      expect(wrapper.prop('href')).toEqual("/some/path");
    });
  });
  describe('onClick callback', function () {
    it('should be invoked onClick', function () {
      var spy = jest.fn();
      var button = shallow(___EmotionJSX(LinkButton, {
        onClick: spy
      }, "text"));
      button.simulate('click');
      expect(spy).toHaveBeenCalled();
    });
    it('should not be invoked if disabled', function () {
      var spy = jest.fn();
      var button = shallow(___EmotionJSX(LinkButton, {
        disabled: true,
        href: "#",
        onClick: spy
      }, "text"));
      button.simulate('click');
      expect(spy).not.toHaveBeenCalled();
    });
  });
});