"use strict";

var _testUtilities = require("testUtilities");
var _index = _interopRequireDefault(require("./index"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
it("renders", function () {
  var _renderHookWithProvid = (0, _testUtilities.renderHookWithProviders)(function () {
      return (0, _index["default"])();
    }),
    result = _renderHookWithProvid.result;
  expect(result.current[0].current).toBeUndefined();
});
it("sets value", function () {
  var _renderHookWithProvid2 = (0, _testUtilities.renderHookWithProviders)(function () {
      return (0, _index["default"])();
    }),
    result = _renderHookWithProvid2.result;
  (0, _testUtilities.act)(function () {
    result.current[1]("test");
  });
  expect(result.current[0].current).toBe("test");
});
it("sets parent as reference", function () {
  var parentRef = {
    current: undefined
  };
  var _renderHookWithProvid3 = (0, _testUtilities.renderHookWithProviders)(function () {
      return (0, _index["default"])(parentRef);
    }),
    result = _renderHookWithProvid3.result;
  (0, _testUtilities.act)(function () {
    result.current[1]("test");
  });
  expect(parentRef.current).toBe("test");
});
it("sets parent as callback", function () {
  var parentRef = jest.fn();
  var _renderHookWithProvid4 = (0, _testUtilities.renderHookWithProviders)(function () {
      return (0, _index["default"])(parentRef);
    }),
    result = _renderHookWithProvid4.result;
  (0, _testUtilities.act)(function () {
    result.current[1]("test");
  });
  expect(parentRef).toHaveBeenCalledWith("test");
});