diff options
author | Indrijeet kumar <indriku1@in.ibm.com> | 2020-06-15 00:48:42 +0530 |
---|---|---|
committer | Indrijeet Kumar <indriku1@in.ibm.com> | 2020-06-15 02:01:31 +0000 |
commit | a517be8c1212f63535a9fd5ef1d933a9e58961bf (patch) | |
tree | b120b0b640a3f56296930c6f3423aca07999d064 | |
parent | 88a56a8071697d2a7dfa7db7e32c8a496218fb70 (diff) |
Modification in some components
Modification in some components
Issue-ID: PORTAL-813
Change-Id: I2c2c568ee436d070754277f61a1e0cd053206a8d
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
2 files changed, 3 insertions, 13 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts index 1c08a97a..650f09a6 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts @@ -36,7 +36,6 @@ * * ============LICENSE_END============================================ * - * */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; @@ -46,13 +45,10 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { RouterTestingModule } from '@angular/router/testing'; import { CookieService } from 'ngx-cookie-service'; -import { MockBackend } from '@angular/http/testing'; -import { BaseRequestOptions, Http } from '@angular/http'; import { AdminService } from '../../admin.service'; import 'rxjs/add/operator/toPromise'; import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MaterialModule } from 'portalsdk-tag-lib/material-module'; import 'rxjs/add/observable/of'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/catch'; @@ -64,7 +60,6 @@ describe('NewMenuComponent', () => { let component: NewMenuComponent; let fixture: ComponentFixture<NewMenuComponent>; let adminService:AdminService; - // let entryComponents:any; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -149,6 +144,8 @@ describe('NewMenuComponent', () => { let spy=spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.of('your object')); component.getFunctionCDselectData(); expect(spy).toHaveBeenCalled(); + expect(component.result).toEqual('your object'); + expect(component.functionCDselectData).toEqual('your object'); }) describe('should test getFunctionCDselectData method2',()=>{ @@ -156,6 +153,7 @@ describe('NewMenuComponent', () => { let spy= spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.throw({status:404})) component.getFunctionCDselectData(); expect(spy).toHaveBeenCalled(); + expect(component.showSpinner).toEqual(false); }) }) diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts index 4acf2252..6e5b0c1a 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts @@ -134,7 +134,6 @@ export class NewMenuComponent implements OnInit { }else{ this.menu.menuSetCode='APP'; } - //console.log("selected menu >>>>",this.menu); this.getFunctionCDselectData(); this.getParentData(); } @@ -143,7 +142,6 @@ export class NewMenuComponent implements OnInit { this.showSpinner = true; this.adminService.getParentData() .subscribe( _data => { - //console.log("getParentData :: _data ",_data); this.result = _data; if(_data){ this.parentListSelectData= _data; // data from server @@ -174,9 +172,6 @@ export class NewMenuComponent implements OnInit { } heirarchicalMenuItems.sort(this.sortItems("label")); this.childListSelectData = heirarchicalMenuItems; - //console.log("childListSelectData ::: ",this.childListSelectData); - //console.log("heirarchicalMenuItems ::: ",heirarchicalMenuItems); - //console.log("parentListSelectData ::: ",this.parentListSelectData); } }, error => { this.showSpinner = false; @@ -208,7 +203,6 @@ export class NewMenuComponent implements OnInit { updateFnMenu(){ this.showSpinner = true; - //console.log("updateFnMenu Changes Called..",this.menu); if( this.menu && this.menu.imageSrc == "" ) this.menu.imageSrc = "N/A"; if( this.menu && this.menu.target == "" ) this.menu.target = "N/A"; if( this.menu && this.menu.externalUrl == "" ) this.menu.externalUrl = "N/A"; @@ -230,7 +224,6 @@ export class NewMenuComponent implements OnInit { this.menu.parentId=parseFloat(this.menu.parentId); let data ={availableFnMenuItem: this.menu}; let postData = JSON.stringify(data); - //console.log("postData >>>>>>",postData); this.adminService.updateFnMenuItem(postData) .subscribe( _data => { this.result = _data; @@ -247,7 +240,6 @@ export class NewMenuComponent implements OnInit { } getLeftMenuItems(){ - //console.log("getLeftMenuItems called after update menu"); let sidebarComponent = new SidebarComponent(this.router, this.sidebarService,this.cookieService); sidebarComponent.ngOnInit(); } |