mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
Replace unset unknown keybinding error with warn (#2186)
This commit is contained in:
@@ -149,6 +149,24 @@ describe('useKeybindingStore', () => {
|
||||
expect(() => store.unsetKeybinding(keybinding)).not.toThrow()
|
||||
})
|
||||
|
||||
it('should not throw an error when unsetting unknown keybinding', () => {
|
||||
const store = useKeybindingStore()
|
||||
const keybinding = new KeybindingImpl({
|
||||
commandId: 'test.command',
|
||||
combo: { key: 'I', ctrl: true }
|
||||
})
|
||||
store.addUserKeybinding(keybinding)
|
||||
|
||||
expect(() =>
|
||||
store.unsetKeybinding(
|
||||
new KeybindingImpl({
|
||||
commandId: 'test.foo',
|
||||
combo: { key: 'I', ctrl: true }
|
||||
})
|
||||
)
|
||||
).not.toThrow()
|
||||
})
|
||||
|
||||
it('should remove unset keybinding when adding back a default keybinding', () => {
|
||||
const store = useKeybindingStore()
|
||||
const defaultKeybinding = new KeybindingImpl({
|
||||
|
||||
Reference in New Issue
Block a user