ONOS-1724 - GUI -- svgUnit tests written. WIP topoToolbar unit tests written. Firing key presses programmatically investigated.
Change-Id: Ifff05859ebfebcee513d7fa8c42b52dc62f48f97
diff --git a/web/gui/src/main/webapp/tests/app/fw/util/keys-spec.js b/web/gui/src/main/webapp/tests/app/fw/util/keys-spec.js
index 28cd4c2..227d790 100644
--- a/web/gui/src/main/webapp/tests/app/fw/util/keys-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/util/keys-spec.js
@@ -55,8 +55,16 @@
])).toBeTruthy();
});
- // Code to emulate key presses....
- // NOTE: kinda messy, but it seems to get the job done.
+ // This no longer works because 'initKeyboardEvent' has been depreciated.
+ // Now there is a constructor for 'KeyboardEvent' where you can modify
+ // the new event with a dictionary(?) 'KeyboardEventInit'.
+ // However, the below code has been so recently depreciated, there are no
+ // examples online of how to use the new interface, and some browsers
+ // don't support it still. These tests will have to be put off for a
+ // while more. (Investigated 4/28/15)
+ // Also tried was Angular's triggerHandler() function, but it doesn't seem
+ // that it can take arguments about the event.
+ // Using jQuery in tests might be a good idea, for triggering test events.
function jsKeyDown(element, code) {
var ev = document.createEvent('KeyboardEvent');
@@ -184,8 +192,9 @@
expect(ks.keyBindings().viewFunction).toBeFalsy();
}
- // FIXME: jsKeyDown(...) no longer emulates key presses ?! :(
+ // TODO: jsKeyDown(...) no longer emulates key presses ?! :(
// The following four unit tests ignored until we can figure this out.
+ // INVESTIGATED: see jsKeyDown for details...
xit('should allow specific key bindings', function () {
bindTestKeys();