mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Keymap normalizes key patterns so modifier keys can be listed in a random order.
This commit is contained in:
@@ -125,7 +125,16 @@ describe "Keymap", ->
|
||||
expect(bazHandler).toHaveBeenCalled()
|
||||
|
||||
describe ".bindKeys(selector, fnOrMap)", ->
|
||||
describe "when called with a function", ->
|
||||
describe "when called with a selector and a hash", ->
|
||||
it "normalizes the key patterns in the hash to put the modifiers in alphabetical order", ->
|
||||
fooHandler = jasmine.createSpy('fooHandler')
|
||||
fragment.on 'foo', fooHandler
|
||||
keymap.bindKeys '*', 'ctrl-alt-delete': 'foo'
|
||||
result = keymap.handleKeyEvent(keydownEvent('delete', ctrlKey: true, altKey: true, target: fragment[0]))
|
||||
expect(result).toBe(false)
|
||||
expect(fooHandler).toHaveBeenCalled()
|
||||
|
||||
describe "when called with a selector and a function", ->
|
||||
it "calls the given function when selector matches", ->
|
||||
handler = jasmine.createSpy 'handler'
|
||||
keymap.bindKeys '.child-node', handler
|
||||
|
||||
Reference in New Issue
Block a user