GUI -- Sketching out GlyphService.
- Added areFunctions() to FnService.
- First unit test for GlyphService.
- Added note about debugging unit tests.

Change-Id: I377b6a1cf1845fb57e506e1a935970b49dbf0bbb
diff --git a/web/gui/src/main/webapp/tests/README.txt b/web/gui/src/main/webapp/tests/README.txt
index 68837f4..213b484 100644
--- a/web/gui/src/main/webapp/tests/README.txt
+++ b/web/gui/src/main/webapp/tests/README.txt
@@ -13,3 +13,19 @@
 
 The configuration is currently set to re-run the tests every time a
 file change is detected, (i.e. each time a source file is saved).
+
+----------------------------------------------------------------------
+Useful Notes
+============
+
+Set a 'breakpoint' with the debugger command:
+
+    it('should define four functions', function () {
+        debugger;
+
+        expect(fs.isF(gs.init)).toBeTruthy();
+        // ...
+    });
+
+Open Developer Tools in the captured Chrome browser, and reload the page.
+The debugger will break at the given point, allowing you to inspect context.
diff --git a/web/gui/src/main/webapp/tests/app/fw/svg/glyph-spec.js b/web/gui/src/main/webapp/tests/app/fw/svg/glyph-spec.js
index 568a05b..524a160 100644
--- a/web/gui/src/main/webapp/tests/app/fw/svg/glyph-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/svg/glyph-spec.js
@@ -20,11 +20,13 @@
  @author Simon Hunt
  */
 describe('factory: fw/svg/glyph.js', function() {
-    var gs;
+    var $log, fs, gs;
 
-    beforeEach(module('onosSvg'));
+    beforeEach(module('onosUtil', 'onosSvg'));
 
-    beforeEach(inject(function (GlyphService) {
+    beforeEach(inject(function (_$log_, FnService, GlyphService) {
+        $log = _$log_;
+        fs = FnService;
         gs = GlyphService;
     }));
 
@@ -32,5 +34,11 @@
         expect(gs).toBeDefined();
     });
 
+    it('should define four functions', function () {
+        expect(fs.areFunctions(gs, [
+            'init', 'register', 'ids', 'loadDefs'
+        ])).toBeTruthy();
+    });
+
     // TODO: unit tests for glyph functions
 });
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 4b99942..d5c6fb2 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
@@ -158,4 +158,34 @@
         expect(fs.contains(someArray, 109)).toBeFalsy();
         expect(fs.contains(stringArray, 'zonko')).toBeFalsy();
     });
+
+    // === Tests for areFunctions()
+    it('areFunctions(): false for non-array', function () {
+        expect(fs.areFunctions({}, 'not-an-array')).toBeFalsy();
+    });
+    it('areFunctions(): true for empty-array', function () {
+        expect(fs.areFunctions({}, [])).toBeTruthy();
+    });
+    it('areFunctions(): true for some api', function () {
+        expect(fs.areFunctions({
+            a: function () {},
+            b: function () {}
+        }, ['b', 'a'])).toBeTruthy();
+    });
+    it('areFunctions(): false for some other api', function () {
+        expect(fs.areFunctions({
+            a: function () {},
+            b: 'not-a-function'
+        }, ['b', 'a'])).toBeFalsy();
+    });
+    it('areFunctions(): extraneous stuff ignored', function () {
+        expect(fs.areFunctions({
+            a: function () {},
+            b: function () {},
+            c: 1,
+            d: 'foo'
+        }, ['a', 'b'])).toBeTruthy();
+    });
+
+
 });