Fix unknown labe (#10934)
## Before  ## After 
This commit is contained in:
@ -10,21 +10,46 @@ describe('getFunctionOutputSchema', () => {
|
|||||||
e: [1, 2, 3],
|
e: [1, 2, 3],
|
||||||
};
|
};
|
||||||
const expectedOutputSchema = {
|
const expectedOutputSchema = {
|
||||||
a: { isLeaf: true, type: 'unknown', value: null, icon: 'IconVariable' },
|
a: {
|
||||||
b: { isLeaf: true, type: 'string', value: 'b', icon: 'IconVariable' },
|
isLeaf: true,
|
||||||
|
type: 'unknown',
|
||||||
|
value: null,
|
||||||
|
icon: 'IconVariable',
|
||||||
|
label: 'a',
|
||||||
|
},
|
||||||
|
b: {
|
||||||
|
isLeaf: true,
|
||||||
|
type: 'string',
|
||||||
|
value: 'b',
|
||||||
|
icon: 'IconVariable',
|
||||||
|
label: 'b',
|
||||||
|
},
|
||||||
c: {
|
c: {
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
icon: 'IconVariable',
|
icon: 'IconVariable',
|
||||||
value: {
|
value: {
|
||||||
cc: { isLeaf: true, type: 'number', value: 1, icon: 'IconVariable' },
|
cc: {
|
||||||
|
isLeaf: true,
|
||||||
|
type: 'number',
|
||||||
|
value: 1,
|
||||||
|
icon: 'IconVariable',
|
||||||
|
label: 'cc',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
d: { isLeaf: true, type: 'boolean', value: true, icon: 'IconVariable' },
|
d: {
|
||||||
|
isLeaf: true,
|
||||||
|
type: 'boolean',
|
||||||
|
value: true,
|
||||||
|
icon: 'IconVariable',
|
||||||
|
label: 'd',
|
||||||
|
},
|
||||||
e: {
|
e: {
|
||||||
isLeaf: true,
|
isLeaf: true,
|
||||||
type: 'array',
|
type: 'array',
|
||||||
value: [1, 2, 3],
|
value: [1, 2, 3],
|
||||||
icon: 'IconVariable',
|
icon: 'IconVariable',
|
||||||
|
label: 'e',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
expect(getFunctionOutputSchema(testResult)).toEqual(expectedOutputSchema);
|
expect(getFunctionOutputSchema(testResult)).toEqual(expectedOutputSchema);
|
||||||
|
|||||||
@ -41,6 +41,7 @@ export const getFunctionOutputSchema = (testResult: object) => {
|
|||||||
value,
|
value,
|
||||||
type: getValueType(value),
|
type: getValueType(value),
|
||||||
icon: 'IconVariable',
|
icon: 'IconVariable',
|
||||||
|
label: key,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return acc;
|
return acc;
|
||||||
|
|||||||
Reference in New Issue
Block a user