summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts8
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.ts8
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();
}