import { renderHookWithProviders, act } from "testUtilities";
import useForwardRef from "./index";
it("renders", function () {
  var _renderHookWithProvid = renderHookWithProviders(function () {
      return useForwardRef();
    }),
    result = _renderHookWithProvid.result;
  expect(result.current[0].current).toBeUndefined();
});
it("sets value", function () {
  var _renderHookWithProvid2 = renderHookWithProviders(function () {
      return useForwardRef();
    }),
    result = _renderHookWithProvid2.result;
  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 = renderHookWithProviders(function () {
      return useForwardRef(parentRef);
    }),
    result = _renderHookWithProvid3.result;
  act(function () {
    result.current[1]("test");
  });
  expect(parentRef.current).toBe("test");
});
it("sets parent as callback", function () {
  var parentRef = jest.fn();
  var _renderHookWithProvid4 = renderHookWithProviders(function () {
      return useForwardRef(parentRef);
    }),
    result = _renderHookWithProvid4.result;
  act(function () {
    result.current[1]("test");
  });
  expect(parentRef).toBeCalledWith("test");
});