"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ObjectHelper_1 = require("../../../src/util/ObjectHelper");
describe('Object Helper', () => {
    describe('Merge Deep', () => {
        it('should return object rather than null', () => {
            const override = null;
            const override2 = {
                Navigation: {
                    Title: 'Title',
                },
            };
            const result = (0, ObjectHelper_1.mergeDeep)(override, override2);
            const result1 = (0, ObjectHelper_1.mergeDeep)(override2, override);
            expect(result.Navigation.Title).toEqual('Title');
            expect(result1.Navigation.Title).toEqual('Title');
        });
        it('should prioritize object rather than primitive value', function () {
            const override = {
                Navigation: {
                    Title: 'Title',
                },
            };
            const override1 = {
                Navigation: {
                    Title: {
                        Top: 'Top',
                    },
                },
            };
            const result = (0, ObjectHelper_1.mergeDeep)(override, override1);
            const result1 = (0, ObjectHelper_1.mergeDeep)(override1, override);
            expect(result.Navigation.Title.Top).toEqual('Top');
            expect(result1.Navigation.Title.Top).toEqual('Top');
        });
        it('should update new value', function () {
            const override = {
                Navigation: {
                    Title: 'Title',
                },
            };
            const override1 = {
                Navigation: {
                    Title: 'Updated Title',
                },
            };
            const result = (0, ObjectHelper_1.mergeDeep)(override, override1);
            const result1 = (0, ObjectHelper_1.mergeDeep)(override1, override);
            expect(result.Navigation.Title).toEqual('Updated Title');
            expect(result1.Navigation.Title).toEqual('Title');
        });
        it('should not mutate inputs', function () {
            const override = {
                Navigation: {
                    Title: 'Title',
                },
            };
            const override1 = {
                Navigation: {
                    Title: 'Updated Title',
                },
            };
            (0, ObjectHelper_1.mergeDeep)(override, override1);
            expect(override.Navigation.Title).toEqual('Title');
            expect(override1.Navigation.Title).toEqual('Updated Title');
            (0, ObjectHelper_1.mergeDeep)(override1, override);
            expect(override.Navigation.Title).toEqual('Title');
            expect(override1.Navigation.Title).toEqual('Updated Title');
        });
    });
});
//# sourceMappingURL=ObjectHelper.test.js.map