diff --git a/packages/editor-ui/src/components/canvas/elements/nodes/CanvasNode.vue b/packages/editor-ui/src/components/canvas/elements/nodes/CanvasNode.vue index d02eee92a3..df1eebf332 100644 --- a/packages/editor-ui/src/components/canvas/elements/nodes/CanvasNode.vue +++ b/packages/editor-ui/src/components/canvas/elements/nodes/CanvasNode.vue @@ -313,7 +313,6 @@ onBeforeUnmount(() => { @open:contextmenu="onOpenContextMenuFromNode" > { expect(result).toBe(expectedDescription); }); - it('should throw an error when node type does not exist', () => { - const type = 'nonexistentType'; - const { requireNodeTypeDescription } = useCanvasOperations({ router }); - - expect(() => { - requireNodeTypeDescription(type); - }).toThrow(); - }); - it('should return node type description when only type is provided and it exists', () => { const nodeTypesStore = useNodeTypesStore(); const type = 'testTypeWithoutVersion'; @@ -123,6 +114,25 @@ describe('useCanvasOperations', () => { expect(result).toBe(expectedDescription); }); + + it("should return placeholder node type description if node type doesn't exist", () => { + const type = 'nonexistentType'; + + const { requireNodeTypeDescription } = useCanvasOperations({ router }); + const result = requireNodeTypeDescription(type); + + expect(result).toEqual({ + name: type, + displayName: type, + description: '', + defaults: {}, + group: [], + inputs: [], + outputs: [], + properties: [], + version: 1, + }); + }); }); describe('addNode', () => { diff --git a/packages/editor-ui/src/composables/useCanvasOperations.ts b/packages/editor-ui/src/composables/useCanvasOperations.ts index ca268b645f..c27ba12db8 100644 --- a/packages/editor-ui/src/composables/useCanvasOperations.ts +++ b/packages/editor-ui/src/composables/useCanvasOperations.ts @@ -445,16 +445,23 @@ export function useCanvasOperations({ router }: { router: ReturnType