import { renderHook } from '@testing-library/react';
import { useMemoizedIdentity } from './useMemoizedIdentity';
describe('useMemoizedIdentity', () => {
    it('should return previous value if its deeply equal to the new one', () => {
        const initialValue = { foo: 'bar', baz: { qux: 'quux' } };
        const updatedValue = { foo: 'bar', baz: { qux: 'quux' } };
        const { result: initialResult } = renderHook(() => useMemoizedIdentity(initialValue));
        const { result: updatedResult } = renderHook(() => 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', () => {
        const initialValue = { foo: 'bar', baz: { qux: 'quux' } };
        const updatedValue = { foo: 'bar', baz: {} };
        const { result: initialResult } = renderHook(() => useMemoizedIdentity(initialValue));
        const { result: updatedResult } = renderHook(() => useMemoizedIdentity(updatedValue));
        expect(initialResult.current).toStrictEqual(initialValue);
        expect(updatedResult.current).toStrictEqual(updatedValue);
    });
});
//# sourceMappingURL=useMemoizedIdentity.spec.js.map