mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 01:04:06 +00:00
[feat] Hide subgraph nodes from node library and search (#4498)
This commit is contained in:
@@ -236,6 +236,45 @@ describe('useNodeDefStore', () => {
|
||||
|
||||
expect(store.visibleNodeDefs).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('should hide subgraph nodes by default', () => {
|
||||
const normalNode = createMockNodeDef({
|
||||
name: 'normal',
|
||||
category: 'conditioning',
|
||||
python_module: 'nodes'
|
||||
})
|
||||
const subgraphNode = createMockNodeDef({
|
||||
name: 'MySubgraph',
|
||||
category: 'subgraph',
|
||||
python_module: 'nodes'
|
||||
})
|
||||
|
||||
store.updateNodeDefs([normalNode, subgraphNode])
|
||||
|
||||
expect(store.visibleNodeDefs).toHaveLength(1)
|
||||
expect(store.visibleNodeDefs[0].name).toBe('normal')
|
||||
})
|
||||
|
||||
it('should show non-subgraph nodes with subgraph category', () => {
|
||||
const normalNode = createMockNodeDef({
|
||||
name: 'normal',
|
||||
category: 'conditioning',
|
||||
python_module: 'custom_extension'
|
||||
})
|
||||
const fakeSubgraphNode = createMockNodeDef({
|
||||
name: 'FakeSubgraph',
|
||||
category: 'subgraph',
|
||||
python_module: 'custom_extension' // Different python_module
|
||||
})
|
||||
|
||||
store.updateNodeDefs([normalNode, fakeSubgraphNode])
|
||||
|
||||
expect(store.visibleNodeDefs).toHaveLength(2)
|
||||
expect(store.visibleNodeDefs.map((n) => n.name)).toEqual([
|
||||
'normal',
|
||||
'FakeSubgraph'
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('performance', () => {
|
||||
|
||||
Reference in New Issue
Block a user