mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 17:24:07 +00:00
test: add widget re-registration overwrite test
This commit is contained in:
@@ -53,6 +53,18 @@ describe('widgetRegistry', () => {
|
||||
expect(getComponent('MY_WIDGET', 'test')).toBe(MockComponent)
|
||||
expect(getComponent('MYWIDGET', 'test')).toBe(MockComponent)
|
||||
})
|
||||
|
||||
it('should overwrite previous entry when re-registering same widget key', () => {
|
||||
registerVueWidgets({
|
||||
myWidget: { component: MockComponent }
|
||||
})
|
||||
|
||||
registerVueWidgets({
|
||||
myWidget: { component: MockComponent2 }
|
||||
})
|
||||
|
||||
expect(getComponent('myWidget', 'test')).toBe(MockComponent2)
|
||||
})
|
||||
})
|
||||
|
||||
describe('getComponent', () => {
|
||||
|
||||
Reference in New Issue
Block a user