pulsar/spec/spec-helper.coffee
Nathan Sobo 18e614e88d Start experiment: associate key bindings with CSS selectors
KeyEventHandler holds references to BindingSets. The name "binding set"
is based on the concept of a CSS ruleset. The idea is to choose a key
binding for an event based on what selectors (match / most closely
contain) the event's target DOM node.
2012-01-11 13:16:10 -08:00

25 lines
618 B
CoffeeScript

nakedLoad 'jasmine-jquery'
$ = require 'jquery'
_ = require 'underscore'
Native = require 'native'
afterEach ->
(new Native).resetMainMenu()
window.atom = new (require 'app')
window.keydown = (pattern) ->
console.log @createKeyEvent(pattern)
$(document).trigger @createKeyEvent(pattern)
window.createKeyEvent = (pattern) ->
$.Event "keydown", atom.keyBinder.parseKeyPattern(pattern)
window.keypressEvent = (pattern, properties={}) ->
$.Event "keypress", _.extend(atom.keyBinder.parseKeyPattern(pattern), properties)
window.waitsForPromise = (fn) ->
window.waitsFor (moveOn) ->
fn().done(moveOn)