diff --git a/packages/core/admin/admin/src/content-manager/components/EditViewDataManagerProvider/utils/tests/findLeafByPathAndReplace.test.js b/packages/core/admin/admin/src/content-manager/components/EditViewDataManagerProvider/utils/tests/findLeafByPathAndReplace.test.js index 31a17ae470..94cbd4f6a0 100644 --- a/packages/core/admin/admin/src/content-manager/components/EditViewDataManagerProvider/utils/tests/findLeafByPathAndReplace.test.js +++ b/packages/core/admin/admin/src/content-manager/components/EditViewDataManagerProvider/utils/tests/findLeafByPathAndReplace.test.js @@ -18,13 +18,15 @@ describe('findLeafByPathAndReplace', () => { path.reduce(findLeaf, obj); - expect(obj).toMatchObject({ - a: { - b: { - c: [], + expect(obj).toMatchInlineSnapshot(` + { + "a": { + "b": { + "c": [], + }, }, - }, - }); + } + `); }); it('should replace the value of the leaf by the provided one for all cases in the event of the leaf being a branch of an array', () => { @@ -49,18 +51,20 @@ describe('findLeafByPathAndReplace', () => { path.reduce(findLeaf, obj); - expect(obj).toMatchObject({ - a: { - b: [ - { - c: [], - }, - { - c: [], - }, - ], - }, - }); + expect(obj).toMatchInlineSnapshot(` + { + "a": { + "b": [ + { + "c": [], + }, + { + "c": [], + }, + ], + }, + } + `); }); it('should only replace the leaf declared no matter how many duplicate exist higher in the tree', () => { @@ -97,30 +101,32 @@ describe('findLeafByPathAndReplace', () => { path.reduce(findLeaf, obj); - expect(obj).toMatchObject({ - a: { - b: [ - { - c: false, - d: { - e: [ - { - f: { - c: [], + expect(obj).toMatchInlineSnapshot(` + { + "a": { + "b": [ + { + "c": false, + "d": { + "e": [ + { + "f": { + "c": [], + }, }, - }, - { - f: { - c: [], + { + "f": { + "c": [], + }, }, - }, - ], + ], + }, }, - }, - ], - c: false, - }, - }); + ], + "c": false, + }, + } + `); }); it('should only replace the leaf if it is the last item in the array of paths', () => { @@ -142,14 +148,16 @@ describe('findLeafByPathAndReplace', () => { path.reduce(findLeaf, obj); - expect(obj).toMatchObject({ - a: { - a: [ - { - a: [], - }, - ], - }, - }); + expect(obj).toMatchInlineSnapshot(` + { + "a": { + "a": [ + { + "a": [], + }, + ], + }, + } + `); }); });