Permalink
Browse files

Fix misleading test (that was still "working").

There never was a KeyCodes.COLON or KeyCodes.EXCLAMATION. The test was a lie since the beginning. Things still "worked" because some type coercion happened, but it wasn't really testing things right since in fact they both evaluated to undefined, and so were actually the same fake keycode...

RELNOTES: n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213267598
  • Loading branch information...
jplaisted committed Sep 17, 2018
1 parent 2637d08 commit 18fbadf2867fb7ad4f929e1523dd249fdabbbb58
Showing with 6 additions and 6 deletions.
  1. +6 −6 closure/goog/ui/keyboardshortcuthandler_test.js
@@ -372,17 +372,17 @@ function testCanRemoveOneHandler() {
// register 2 handlers, then remove quitvi
handler.registerShortcut(
'quitvi', KeyCodes.COLON, Modifiers.NONE, KeyCodes.Q, Modifiers.NONE,
KeyCodes.EXCLAMATION, Modifiers.NONE);
'quitvi', KeyCodes.SEMICOLON, Modifiers.SHIFT, KeyCodes.Q, Modifiers.NONE,
KeyCodes.ONE, Modifiers.SHIFT);
handler.registerShortcut('letterex', 'x');
handler.unregisterShortcut(
KeyCodes.COLON, Modifiers.NONE, KeyCodes.Q, Modifiers.NONE,
KeyCodes.EXCLAMATION, Modifiers.NONE);
KeyCodes.SEMICOLON, Modifiers.SHIFT, KeyCodes.Q, Modifiers.NONE,
KeyCodes.ONE, Modifiers.SHIFT);
// call the "quit VI" keycodes, even though it is removed
fire(KeyCodes.COLON);
fire(KeyCodes.SEMICOLON, Modifiers.SHIFT);
fire(KeyCodes.Q);
fire(KeyCodes.EXCLAMATION);
fire(KeyCodes.ONE, Modifiers.SHIFT);
// press the letter x
fire(KeyCodes.X);

0 comments on commit 18fbadf

Please sign in to comment.