Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for scoping

  • Loading branch information...
commit 78c62a3f4750485a83ba55ce056d8d8300540aca 1 parent 0a96e36
@agnoster agnoster authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 test/keymaster.html
View
17 test/keymaster.html
@@ -155,7 +155,22 @@
},
testScoping: function(t){
- // TODO
+ var sequence = '';
+
+ key('a', function(){ sequence += 'a' });
+ key('b', function(){ sequence += 'b' });
+ key('b', 'capital', function(){ sequence += 'B' });
+
+ keydown(65); keyup(65);
+ key.setScope('capital');
+ keydown(66); keyup(66);
+ keydown(65); keyup(65);
+ key.setScope('unknown');
+ keydown(66); keyup(66);
+ key.setScope('all');
+ keydown(65); keyup(65);
+
+ t.assertEqual('abBaba', sequence);
},
testDoesntFireOnUserInputElements: function(t){
Please sign in to comment.
Something went wrong with that request. Please try again.