GUI -- Topology - PortStats traffic: enhanced to change link style based on values (KBps, MBps, GBps).

Change-Id: I67a62ef85a292db431f3d32eefefd81d4e564794
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 d04b3c2..c9f3bef 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
@@ -214,7 +214,7 @@
             'isF', 'isA', 'isS', 'isO', 'contains',
             'areFunctions', 'areFunctionsNonStrict', 'windowSize', 'isMobile',
             'find', 'inArray', 'removeFromArray', 'isEmptyObject', 'cap',
-            'noPx', 'noPxStyle'
+            'noPx', 'noPxStyle', 'endsWith', 'parseBitRate'
         ])).toBeTruthy();
     });
 
@@ -413,4 +413,34 @@
         d3.select('#fooElem').remove();
     });
 
+    // === Tests for endsWith()
+    it('should return true if string ends with foo', function () {
+        expect(fs.endsWith("barfoo", "foo")).toBe(true);
+    });
+
+    it('should return false if string doesnt end with foo', function () {
+        expect(fs.endsWith("barfood", "foo")).toBe(false);
+    });
+
+    // === Tests for parseBitRate()
+    it('should return 5 - a', function () {
+        expect(fs.parseBitRate('5.47 KBps')).toBe(5);
+    });
+
+    it('should return 5 - b', function () {
+        expect(fs.parseBitRate('5. KBps')).toBe(5);
+    });
+
+    it('should return 5 - c', function () {
+        expect(fs.parseBitRate('5 KBps')).toBe(5);
+    });
+
+    it('should return 5 - d', function () {
+        expect(fs.parseBitRate('5 Kbps')).toBe(5);
+    });
+
+    it('should return 2001', function () {
+        expect(fs.parseBitRate('2,001.59 Gbps')).toBe(2001);
+    });
 });
+