"use strict";

var _react = require("@testing-library/react");
var _useMemoizedIdentity = require("./useMemoizedIdentity");
describe('useMemoizedIdentity', () => {
  it('should return previous value if its deeply equal to the new one', () => {
    var initialValue = {
      foo: 'bar',
      baz: {
        qux: 'quux'
      }
    };
    var updatedValue = {
      foo: 'bar',
      baz: {
        qux: 'quux'
      }
    };
    var {
      result: initialResult
    } = (0, _react.renderHook)(() => (0, _useMemoizedIdentity.useMemoizedIdentity)(initialValue));
    var {
      result: updatedResult
    } = (0, _react.renderHook)(() => (0, _useMemoizedIdentity.useMemoizedIdentity)(updatedValue));
    expect(initialResult.current).toStrictEqual(initialValue);
    expect(updatedResult.current).toStrictEqual(initialValue);
  });
  it('should return new value if its not deeply equal to the previous one', () => {
    var initialValue = {
      foo: 'bar',
      baz: {
        qux: 'quux'
      }
    };
    var updatedValue = {
      foo: 'bar',
      baz: {}
    };
    var {
      result: initialResult
    } = (0, _react.renderHook)(() => (0, _useMemoizedIdentity.useMemoizedIdentity)(initialValue));
    var {
      result: updatedResult
    } = (0, _react.renderHook)(() => (0, _useMemoizedIdentity.useMemoizedIdentity)(updatedValue));
    expect(initialResult.current).toStrictEqual(initialValue);
    expect(updatedResult.current).toStrictEqual(updatedValue);
  });
});
//# sourceMappingURL=useMemoizedIdentity.spec.js.map