mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 01:09:49 +00:00
chore: update snapshots
This commit is contained in:
parent
559c4ccd3d
commit
5e63ffa0ec
@ -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: [
|
|
||||||
{
|
{
|
||||||
c: [],
|
"a": {
|
||||||
|
"b": [
|
||||||
|
{
|
||||||
|
"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: [
|
|
||||||
{
|
{
|
||||||
c: false,
|
"a": {
|
||||||
d: {
|
"b": [
|
||||||
e: [
|
|
||||||
{
|
{
|
||||||
f: {
|
"c": false,
|
||||||
c: [],
|
"d": {
|
||||||
|
"e": [
|
||||||
|
{
|
||||||
|
"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": [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
});
|
}
|
||||||
|
`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user