From 5ac0ca9da72b3340b1fae90c07ea058ee227c313 Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Sun, 14 Jun 2020 23:42:42 +0530 Subject: Some modifications in header components Some modifications in header components Issue-ID: PORTAL-813 Change-Id: I97e0eed195c48c2779440e71cb33a577d19f801e Signed-off-by: Indrijeet Kumar --- .../src/app/layout/components/header/header.component.spec.ts | 9 ++++----- .../ngapp/src/app/layout/components/header/header.component.ts | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'ecomp-sdk/epsdk-app-overlay') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts index bd9bea48..4b3e1c7c 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts @@ -47,7 +47,6 @@ import { LayoutModule } from '../../layout.module'; import { CookieService } from 'ngx-cookie-service'; import { HeaderService } from 'src/app/shared/services/header/header.service'; import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { Router } from '@angular/router'; import 'rxjs/add/observable/of'; import { Observable } from 'rxjs/Observable'; @@ -55,11 +54,8 @@ import { Observable } from 'rxjs/Observable'; describe('HeaderComponent', () => { let headerService:HeaderService; - let cookieService:CookieService; - let router:Router; let component: HeaderComponent; let fixture: ComponentFixture; - let spy: any; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -83,7 +79,6 @@ describe('HeaderComponent', () => { component = fixture.componentInstance; fixture.detectChanges(); headerService = TestBed.get(HeaderService); - cookieService=TestBed.get(CookieService); }); @@ -96,6 +91,10 @@ describe('HeaderComponent', () => { let spy=spyOn(headerService, 'getTopMenuItems').and.returnValue(Observable.of('you object')); component.ngOnInit(); expect(spy).toHaveBeenCalled(); + expect(component.userFirstName).toEqual(component.response.firstName); + expect(component.userEmail).toEqual(component.response.email); + expect(component.userId).toEqual(component.response.userid); + expect(component.userName).toEqual(component.userName); }) }) diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts index 7bf5c649..1e447c72 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.ts @@ -38,8 +38,6 @@ import { Component, OnInit } from '@angular/core'; import { Router, NavigationEnd } from '@angular/router'; import { HeaderService } from '../../../shared/services/header/header.service'; -import { UserService } from 'src/app/shared/services/user/user.service'; -import { User } from 'src/app/shared/services/user/user'; import { CookieService } from 'ngx-cookie-service'; @Component({ -- cgit 1.2.3-korg