"use strict";

var _testUtilities = require("testUtilities");
var _ = _interopRequireDefault(require("."));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
it("returns the false by default", function () {
  var _renderHook = (0, _testUtilities.renderHook)(function (value) {
      return (0, _["default"])(value);
    }, {
      initialProps: undefined
    }),
    result = _renderHook.result;
  expect(result.current[0]).toBe(false);
});
it("returns the initial value", function () {
  var _renderHook2 = (0, _testUtilities.renderHook)(function (value) {
      return (0, _["default"])(value);
    }, {
      initialProps: true
    }),
    result = _renderHook2.result;
  expect(result.current[0]).toBe(true);
});
it("toggles the value", function () {
  var _renderHook3 = (0, _testUtilities.renderHook)(function (value) {
      return (0, _["default"])(value);
    }, {
      initialProps: true
    }),
    result = _renderHook3.result;
  var _result$current = result.current,
    toggle = _result$current[1];
  (0, _testUtilities.act)(function () {
    toggle();
  });
  expect(result.current[0]).toBe(false);
  (0, _testUtilities.act)(function () {
    toggle();
  });
  expect(result.current[0]).toBe(true);
});
it("toggles on", function () {
  var _renderHook4 = (0, _testUtilities.renderHook)(function (value) {
      return (0, _["default"])(value);
    }, {
      initialProps: false
    }),
    result = _renderHook4.result;
  var _result$current2 = result.current,
    toggleOn = _result$current2[2];
  (0, _testUtilities.act)(function () {
    toggleOn();
  });
  expect(result.current[0]).toBe(true);
});
it("toggles off", function () {
  var _renderHook5 = (0, _testUtilities.renderHook)(function (value) {
      return (0, _["default"])(value);
    }, {
      initialProps: true
    }),
    result = _renderHook5.result;
  var _result$current3 = result.current,
    toggleOff = _result$current3[3];
  (0, _testUtilities.act)(function () {
    toggleOff();
  });
  expect(result.current[0]).toBe(false);
});