summaryrefslogtreecommitdiffstats
path: root/tests/test.mousetrap.js
diff options
context:
space:
mode:
authorCraig Campbell <iamcraigcampbell@gmail.com>2016-05-29 09:56:41 -0400
committerCraig Campbell <iamcraigcampbell@gmail.com>2016-05-29 09:57:39 -0400
commit35c73fddf78380f69e21493674754a2663a36ea9 (patch)
tree5f0fd0a2d9e285b3ae708b39d4e7723252ba0f36 /tests/test.mousetrap.js
parent3e58a70435975dd13a91dee132fcb6a8eaeb943f (diff)
downloadmousetrap-origin/master.zip
mousetrap-origin/master.tar.gz
mousetrap-origin/master.tar.bz2
Make sure mousetrap works with numpad 0HEADorigin/masterorigin/HEADmaster
Thanks @jhonatandarosa and @tshinnic for figuring this one out! Closes #258
Diffstat (limited to 'tests/test.mousetrap.js')
-rw-r--r--tests/test.mousetrap.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test.mousetrap.js b/tests/test.mousetrap.js
index da5829b..98310da 100644
--- a/tests/test.mousetrap.js
+++ b/tests/test.mousetrap.js
@@ -269,6 +269,19 @@ describe('Mousetrap.bind', function() {
KeyEvent.simulate('O'.charCodeAt(0), 79, ['meta', 'shift']);
expect(spy.callCount).to.equal(1, 'command+o callback should fire');
});
+
+ it('should fire callback when ctrl+numpad 0 is pressed', function() {
+ var spy = sinon.spy();
+
+ Mousetrap.bind('ctrl+0', spy);
+
+ // numpad 0 keycode
+ KeyEvent.simulate(96, 96, ['ctrl']);
+
+ expect(spy.callCount).to.equal(1, 'callback should fire once');
+ expect(spy.args[0][0]).to.be.an.instanceOf(Event, 'first argument should be Event');
+ expect(spy.args[0][1]).to.equal('ctrl+0', 'second argument should be key combo');
+ });
});
describe('sequences', function() {