Fix node def handling of undefined fields (#1199)

* Fix node def handling

* nit

* Add test
This commit is contained in:
Chenlei Hu
2024-10-09 22:11:27 -04:00
committed by GitHub
parent 59a5f5f5d0
commit f71595fcc9
3 changed files with 22 additions and 8 deletions

View File

@@ -356,6 +356,20 @@ describe('ComfyNodeDefImpl', () => {
expect(result.output.all).toEqual([])
})
it('should handle undefined fields', () => {
const plainObject = {
name: 'EmptyOutputNode',
display_name: 'Empty Output Node',
category: 'Test',
python_module: 'test_module',
description: 'A node with no outputs'
}
const result = new ComfyNodeDefImpl(plainObject)
expect(result.output.all).toEqual([])
expect(result.input.all).toEqual([])
})
it('should handle complex input specifications', () => {
const plainObject = {
name: 'ComplexInputNode',