mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 18:24:11 +00:00
[test] Add test to verify targetSelector property deletion
Add a specific test case to ensure the keybinding migration properly deletes the deprecated 'targetSelector' property after migrating to 'targetElementId'. This test provides additional coverage to verify the migration doesn't leave behind obsolete properties. The test verifies: - The old 'targetSelector' property is removed - The new 'targetElementId' property is added with correct value - Other properties remain unchanged
This commit is contained in:
@@ -115,6 +115,24 @@ describe('settingsMigration', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('should delete targetSelector property after migration', async () => {
|
||||
// Setup with old format
|
||||
store.settingValues = {
|
||||
'Comfy.Keybinding.UnsetBindings': [
|
||||
{ targetSelector: '#graph-canvas', key: 'a' }
|
||||
]
|
||||
}
|
||||
|
||||
// Run migration
|
||||
await SETTING_MIGRATIONS[1].migrate()
|
||||
|
||||
// Verify targetSelector is deleted and targetElementId is added
|
||||
const result = store.settingValues['Comfy.Keybinding.UnsetBindings'][0]
|
||||
expect(result).not.toHaveProperty('targetSelector')
|
||||
expect(result).toHaveProperty('targetElementId', 'graph-canvas')
|
||||
expect(result).toHaveProperty('key', 'a')
|
||||
})
|
||||
|
||||
it('should not migrate when all keybindings use new format', () => {
|
||||
// Setup with new format
|
||||
store.settingValues = {
|
||||
|
||||
Reference in New Issue
Block a user