chore: update snapshots

This commit is contained in:
Josh 2023-02-06 12:23:09 +00:00
parent 559c4ccd3d
commit 5e63ffa0ec

View File

@ -18,13 +18,15 @@ describe('findLeafByPathAndReplace', () => {
path.reduce(findLeaf, obj); path.reduce(findLeaf, obj);
expect(obj).toMatchObject({ expect(obj).toMatchInlineSnapshot(`
a: { {
b: { "a": {
c: [], "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', () => { 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); path.reduce(findLeaf, obj);
expect(obj).toMatchObject({ expect(obj).toMatchInlineSnapshot(`
a: { {
b: [ "a": {
{ "b": [
c: [], {
}, "c": [],
{ },
c: [], {
}, "c": [],
], },
}, ],
}); },
}
`);
}); });
it('should only replace the leaf declared no matter how many duplicate exist higher in the tree', () => { 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); path.reduce(findLeaf, obj);
expect(obj).toMatchObject({ expect(obj).toMatchInlineSnapshot(`
a: { {
b: [ "a": {
{ "b": [
c: false, {
d: { "c": false,
e: [ "d": {
{ "e": [
f: { {
c: [], "f": {
"c": [],
},
}, },
}, {
{ "f": {
f: { "c": [],
c: [], },
}, },
}, ],
], },
}, },
}, ],
], "c": false,
c: false, },
}, }
}); `);
}); });
it('should only replace the leaf if it is the last item in the array of paths', () => { 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); path.reduce(findLeaf, obj);
expect(obj).toMatchObject({ expect(obj).toMatchInlineSnapshot(`
a: { {
a: [ "a": {
{ "a": [
a: [], {
}, "a": [],
], },
}, ],
}); },
}
`);
}); });
}); });