Browse files

add tests for unbind with scope

  • Loading branch information...
1 parent 4a2e6a9 commit 2d0d7fe37f4e3d86fb0a7eb51050cf28bd6d589e @ryan-nauman ryan-nauman committed Apr 25, 2013
Showing with 25 additions and 0 deletions.
  1. +25 −0 test/keymaster.html
View
25 test/keymaster.html
@@ -288,6 +288,31 @@
t.assertEqual('abaAbBab', sequence);
},
+ testUnbindWithScope: function(t){
+ var cntIssues = 0, cntFiles = 0;
+ key('a', 'issues', function(){ cntIssues++ });
+ key('a', 'files', function(){ cntFiles++ });
+
+ key.setScope('issues');
+ keydown(65);
+ keyup(65);
+ t.assertEqual(1, cntIssues);
+ key.unbind('a', 'issues');
+ keydown(65);
+ keyup(65);
+ t.assertEqual(1, cntIssues);
+
+ key.setScope('files');
+ keydown(65);
+ keyup(65);
+ t.assertEqual(1, cntFiles);
+ key.unbind('a', 'files');
+ keydown(65);
+ keyup(65);
+ t.assertEqual(1, cntFiles);
+ t.assertEqual(1, cntIssues);
+ },
+
testDoesntFireOnUserInputElements: function(t){
// TODO
},

0 comments on commit 2d0d7fe

Please sign in to comment.