mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 08:19:07 +00:00
chore: update snapshots
This commit is contained in:
parent
559c4ccd3d
commit
5e63ffa0ec
@ -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": [],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user