Display host names given in netcfg

Change-Id: I883c9aa06c09221bdc198ea1d47b4cbf8b31fde5
diff --git a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts
index 1929204..ab5fff0 100644
--- a/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts
+++ b/web/gui2-topo-lib/lib/layer/forcesvg/visuals/hostnodesvg/hostnodesvg.component.spec.ts
@@ -13,13 +13,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
 
-import { HostNodeSvgComponent } from './hostnodesvg.component';
+import {HostNodeSvgComponent} from './hostnodesvg.component';
 import {ActivatedRoute, Params} from '@angular/router';
 import {of} from 'rxjs';
 import {LogService} from 'gui2-fw-lib/public_api';
-import {Host} from '../../models';
+import {Host, HostLabelToggle} from '../../models';
 import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
 import {ChangeDetectorRef} from '@angular/core';
 import {BadgeSvgComponent} from '../badgesvg/badgesvg.component';
@@ -44,6 +44,9 @@
         testHost = new Host('host:1');
         testHost.ips = ['10.205.86.123', '192.168.56.10'];
 
+        const topo2BaseData = require('../../tests/topo2Highlights-base-data.json');
+        const topo2BaseHostsData: Host[] = <Host[]><unknown>(topo2BaseData.payload.hosts[2]);
+
         TestBed.configureTestingModule({
             imports: [ BrowserAnimationsModule ],
             declarations: [ HostNodeSvgComponent, BadgeSvgComponent ],
@@ -67,4 +70,24 @@
     it('should create', () => {
         expect(component).toBeTruthy();
     });
+
+    it('should be able to read host data properly', () => {
+        expect(topo2BaseHostsData.length).toBe(5);
+
+        expect(topo2BaseHostsData[0].id).toBe('00:00:00:00:00:30/None');
+
+        component.host = topo2BaseHostsData[0];
+        component.labelToggle = HostLabelToggle.Enum.NONE;
+        expect(component.hostName()).toBe('00:00:00:00:00:30/None');
+
+        component.labelToggle = HostLabelToggle.Enum.NAME;
+        expect(component.hostName()).toBe('h3');
+
+        component.labelToggle = HostLabelToggle.Enum.IP;
+        expect(component.hostName()).toBe('2001:2:3::1');
+
+        component.labelToggle = HostLabelToggle.Enum.MAC;
+        expect(component.hostName()).toBe('00:00:00:00:00:30/None');
+
+    });
 });