"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _react = _interopRequireDefault(require("react"));

var _enzyme = require("enzyme");

var _nativeDispatch = _interopRequireDefault(require("./nativeDispatch"));

describe('dev server entry', function () {
  it('Be able to render the application', function () {
    var cb = jest.fn(); // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events

    var node = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement("div", {
      onClick: function onClick(e) {
        return (0, _nativeDispatch["default"])(e, cb, 'hi world');
      }
    }));
    node.simulate('click');
    expect(cb).toHaveBeenCalled();
  });
  it('should still render with alternate event payloads', function () {
    var event = {
      target: {
        dispatchEvent: jest.fn()
      },
      rest: {
        value: 'test'
      }
    };
    (0, _nativeDispatch["default"])(event);
    expect(event.target.dispatchEvent).toHaveBeenCalled();
  });
});