[WEB GUI] Fixed tests: (345 test passing, 21 skipped).
Change-Id: Idf24ac6ab599664a052c7cc860a554db82953a79
diff --git a/web/gui/src/main/webapp/tests/app/fw/util/fn-spec.js b/web/gui/src/main/webapp/tests/app/fw/util/fn-spec.js
index efd9c91..7e7dae5 100644
--- a/web/gui/src/main/webapp/tests/app/fw/util/fn-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/util/fn-spec.js
@@ -209,12 +209,14 @@
});
// == use the now-tested areFunctions() on our own api:
- xit('should define api functions', function () {
+ it('should define api functions', function () {
expect(fs.areFunctions(fs, [
'isF', 'isA', 'isS', 'isO', 'contains',
- 'areFunctions', 'areFunctionsNonStrict', 'windowSize', 'isMobile',
- 'find', 'inArray', 'removeFromArray', 'isEmptyObject', 'cap',
- 'noPx', 'noPxStyle', 'endsWith', 'parseBitRate'
+ 'areFunctions', 'areFunctionsNonStrict', 'windowSize',
+ 'isMobile', 'isChrome', 'isSafari', 'isFirefox',
+ 'debugOn', 'debug',
+ 'find', 'inArray', 'removeFromArray', 'isEmptyObject', 'sameObjProps', 'containsObj', 'cap',
+ 'eecode', 'noPx', 'noPxStyle', 'endsWith', 'parseBitRate', 'addToTrie', 'removeFromTrie', 'trieLookup'
])).toBeTruthy();
});
@@ -382,7 +384,7 @@
it('should ignore non-alpha', function () {
expect(fs.cap('123')).toEqual('123');
});
- xit('should capitalize first char', function () {
+ it('should capitalize first char', function () {
expect(fs.cap('Foo')).toEqual('Foo');
expect(fs.cap('foo')).toEqual('Foo');
expect(fs.cap('foo bar')).toEqual('Foo bar');
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 16b115c..dfae70f 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
@@ -17,7 +17,7 @@
/*
ONOS GUI -- Key Handler Service - Unit Tests
*/
-xdescribe('factory: fw/util/keys.js', function() {
+describe('factory: fw/util/keys.js', function() {
var $log, ks, fs, qhs,
d3Elem, elem, last;
@@ -51,7 +51,8 @@
it('should define api functions', function () {
expect(fs.areFunctions(ks, [
- 'bindQhs', 'installOn', 'keyBindings', 'gestureNotes', 'enableKeys'
+ 'bindQhs', 'installOn', 'keyBindings', 'unbindKeys', 'dialogKeys',
+ 'addSeq', 'remSeq', 'gestureNotes', 'enableKeys', 'enableGlobalKeys', 'checkNotGlobal'
])).toBeTruthy();
});
diff --git a/web/gui/src/main/webapp/tests/app/fw/util/prefs-spec.js b/web/gui/src/main/webapp/tests/app/fw/util/prefs-spec.js
index 76e6dfe..a047aba 100644
--- a/web/gui/src/main/webapp/tests/app/fw/util/prefs-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/util/prefs-spec.js
@@ -17,7 +17,7 @@
/*
ONOS GUI -- Util -- User Preference Service - Unit Tests
*/
-xdescribe('factory: fw/util/prefs.js', function() {
+describe('factory: fw/util/prefs.js', function() {
var $cookies, ps, fs;
beforeEach(module('onosUtil', 'onosRemote'));
@@ -44,7 +44,8 @@
it('should define api functions', function () {
expect(fs.areFunctions(ps, [
- 'getPrefs', 'asNumbers', 'setPrefs'
+ 'getPrefs', 'asNumbers', 'setPrefs',
+ 'addListener', 'removeListener'
])).toBe(true);
});
diff --git a/web/gui/src/main/webapp/tests/app/fw/util/theme-spec.js b/web/gui/src/main/webapp/tests/app/fw/util/theme-spec.js
index 256b064..2fffe75 100644
--- a/web/gui/src/main/webapp/tests/app/fw/util/theme-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/util/theme-spec.js
@@ -17,7 +17,7 @@
/*
ONOS GUI -- Util -- Theme Service - Unit Tests
*/
-xdescribe('factory: fw/util/theme.js', function() {
+describe('factory: fw/util/theme.js', function() {
var ts, $log, fs;
beforeEach(module('onosUtil', 'onosRemote'));
@@ -82,6 +82,9 @@
// Note: re-work this once theme-change listeners are implemented
spyOn($log, 'debug');
+ ts.theme('light'); // setting theme lo light (was set to dark by the previous test)
+ $log.debug.calls.reset(); // resetting the spy
+
expect(ts.theme()).toEqual('light');
verifyBodyClass('light', 'dark');
@@ -129,34 +132,26 @@
});
it('should invoke our callback at appropriate times', function () {
- var calls = [],
- phase,
- listener;
- function cb() {
- calls.push(phase);
- }
+ var cb = jasmine.createSpy('cb');
- expect(calls).toEqual([]);
+ var listener;
- phase = 'pre';
+ expect(cb.calls.count()).toEqual(0);
+
ts.toggleTheme(); // -> dark
- phase = 'added';
listener = ts.addListener(cb);
ts.toggleTheme(); // -> light
- phase = 'same';
ts.theme('light'); // (still light - no event)
- phase = 'diff';
ts.theme('dark'); // -> dark
- phase = 'post';
ts.removeListener(listener);
ts.toggleTheme(); // -> light
- expect(calls).toEqual(['added', 'diff']);
+ expect(cb.calls.count()).toEqual(3);
});
});