fix(editor): Fix empty objects in schema view in output panel (#14355)

This commit is contained in:
Elias Meire
2025-04-04 19:38:39 +02:00
committed by GitHub
parent 54fcf58331
commit 2f0b5e488e
4 changed files with 837 additions and 16 deletions

View File

@@ -658,7 +658,22 @@ describe('VirtualSchema.vue', () => {
expect(container).toMatchSnapshot();
});
it('should do something', () => {
expect(true).toBe(true);
it('renders schema for empty objects and arrays', async () => {
useWorkflowsStore().pinData({
node: mockNode1,
data: [{ json: { empty: {}, emptyArray: [], nested: [{ empty: {}, emptyArray: [] }] } }],
});
const { container, getAllByTestId } = renderComponent({
props: {
nodes: [{ name: mockNode1.name, indicies: [], depth: 1 }],
},
});
await waitFor(() => {
const headers = getAllByTestId('run-data-schema-header');
expect(headers.length).toBe(2);
});
expect(container).toMatchSnapshot();
});
});