"use strict";

var _react = _interopRequireDefault(require("react"));
var _noop = _interopRequireDefault(require("lodash/noop"));
var _mount = _interopRequireDefault(require("enzyme/mount"));
var _render = _interopRequireDefault(require("enzyme/render"));
var _index = _interopRequireDefault(require("./index"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/* eslint-env jest */

jest.mock("../../../../Shared/Components/CallToAction", function () {
  return {
    __esModule: true,
    "default": function _default() {
      return /*#__PURE__*/_react["default"].createElement("div", null);
    }
  };
});
it('renders correctly', function () {
  var tree = (0, _render["default"])( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    onImageFileSelected: _noop["default"],
    onAddTextClick: _noop["default"]
  }));
  expect(tree).toMatchSnapshot();
});
it('renders a boxed component with the boxed prop', function () {
  var tree = (0, _render["default"])( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    onImageFileSelected: _noop["default"],
    onAddTextClick: _noop["default"],
    boxed: true
  }));
  expect(tree).toMatchSnapshot();
});
it('calls the onImageFileSelected callback when the user clicks the onImageFileSelected button', function () {
  var spy = jest.fn();
  var tree = (0, _mount["default"])( /*#__PURE__*/_react["default"].createElement(_index["default"], {
    onImageFileSelected: spy,
    onAddTextClick: _noop["default"]
  }));
  tree.find('button').at(0).find('input').simulate('change', {
    value: ''
  });
  expect(spy).toHaveBeenCalled();
});