mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Remove overkill assertions
This commit is contained in:
parent
bfbdfb46a8
commit
5e0dd80366
@ -5,9 +5,9 @@ describe "ConfigPanel", ->
|
||||
class TestPanel extends ConfigPanel
|
||||
@content: ->
|
||||
@div =>
|
||||
@input outlet: 'intInput', name: 'foo.int', type: 'int'
|
||||
@input outlet: 'floatInput', name: 'foo.float', type: 'float'
|
||||
@input outlet: 'stringInput', name: 'foo.string', type: 'string'
|
||||
@input outlet: 'intInput', id: 'foo.int', type: 'int'
|
||||
@input outlet: 'floatInput', id: 'foo.float', type: 'float'
|
||||
@input outlet: 'stringInput', id: 'foo.string', type: 'string'
|
||||
|
||||
config.set('foo.int', 22)
|
||||
|
||||
|
@ -165,6 +165,14 @@ describe "Keymap", ->
|
||||
expect(deleteCharHandler).not.toHaveBeenCalled()
|
||||
expect(insertCharHandler).not.toHaveBeenCalled()
|
||||
|
||||
describe "when the event matches a 'native!' binding", ->
|
||||
it "returns true, allowing the browser's native key handling to process the event", ->
|
||||
keymap.bindKeys '.grandchild-node', 'x': 'native!'
|
||||
nativeHandler = jasmine.createSpy("nativeHandler")
|
||||
fragment.on 'native!', nativeHandler
|
||||
expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment.find('.grandchild-node')[0]))).toBe true
|
||||
expect(nativeHandler).not.toHaveBeenCalled()
|
||||
|
||||
describe "when at least one binding partially matches the event's keystroke", ->
|
||||
[quitHandler, closeOtherWindowsHandler] = []
|
||||
|
||||
|
@ -7,10 +7,10 @@ class ConfigPanel extends View
|
||||
@bindFormFields()
|
||||
|
||||
bindFormFields: ->
|
||||
for input in @find('input[name]').toArray()
|
||||
for input in @find('input[id]').toArray()
|
||||
do (input) =>
|
||||
input = $(input)
|
||||
name = input.attr('name')
|
||||
name = input.attr('id')
|
||||
type = input.attr('type')
|
||||
@observeConfig name, (value) -> input.val(value) if value
|
||||
input.on 'change', ->
|
||||
|
@ -113,7 +113,9 @@ class Keymap
|
||||
candidateBindingSets = @bindingSetsForNode(currentNode, bindingSetsForFirstKeystroke)
|
||||
for bindingSet in candidateBindingSets
|
||||
command = bindingSet.commandForEvent(event)
|
||||
if command
|
||||
if command is 'native!'
|
||||
return true
|
||||
else if command
|
||||
continue if @triggerCommandEvent(event, command)
|
||||
return false
|
||||
else if command == false
|
||||
|
Loading…
Reference in New Issue
Block a user