mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
fix: add required name field to v2 input spec test fixtures
Addresses review feedback: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10647#discussion_r3004212097
This commit is contained in:
@@ -78,18 +78,24 @@ describe('widgetStore', () => {
|
||||
|
||||
it('returns true for v2 spec with known type', () => {
|
||||
const store = useWidgetStore()
|
||||
expect(store.inputIsWidget(v2({ type: 'STRING' }))).toBe(true)
|
||||
expect(
|
||||
store.inputIsWidget(v2({ type: 'STRING', name: 'test_input' }))
|
||||
).toBe(true)
|
||||
})
|
||||
|
||||
it('returns false for v2 spec with unknown type', () => {
|
||||
const store = useWidgetStore()
|
||||
expect(store.inputIsWidget(v2({ type: 'LATENT' }))).toBe(false)
|
||||
expect(
|
||||
store.inputIsWidget(v2({ type: 'LATENT', name: 'test_input' }))
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
it('returns true for custom registered type', () => {
|
||||
const store = useWidgetStore()
|
||||
store.registerCustomWidgets({ MY_WIDGET: vi.fn() })
|
||||
expect(store.inputIsWidget(v2({ type: 'MY_WIDGET' }))).toBe(true)
|
||||
expect(
|
||||
store.inputIsWidget(v2({ type: 'MY_WIDGET', name: 'test_input' }))
|
||||
).toBe(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user