summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorraine Welch <lb2391@att.com>2020-04-02 16:32:31 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-02 16:32:31 +0000
commit7cd8c0eedd2586a0ed52f84113a5d09a72dab947 (patch)
treeafa37ea2aa7fb11b181618d9727b453b690ea0e0
parent36f29d55292e26e0e7ea9f4a0eb3a0dafba2c50c (diff)
parent1a3742cc07327214adcd3052d174254331d92073 (diff)
Merge "test cases written in new-menu component"
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/new-menu/new-menu.component.spec.ts19
1 files changed, 19 insertions, 0 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 5c22346e..1c08a97a 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
@@ -46,10 +46,13 @@ 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';
@@ -61,6 +64,7 @@ describe('NewMenuComponent', () => {
let component: NewMenuComponent;
let fixture: ComponentFixture<NewMenuComponent>;
let adminService:AdminService;
+ // let entryComponents:any;
beforeEach(async(() => {
TestBed.configureTestingModule({
@@ -128,6 +132,13 @@ describe('NewMenuComponent', () => {
expect(spy).toHaveBeenCalled();
})
+ it('should test getParentData method2 error part ',()=>{
+ const children="children";
+ let spy=spyOn(adminService,'getParentData').and.returnValue(Observable.throw({status:404}));
+ component.getParentData();
+ expect(spy).toHaveBeenCalled();
+ })
+
describe('should test getLeftMenuItems',()=>{
it('testing getLeftMenuItems',()=>{
component.getLeftMenuItems();
@@ -140,6 +151,14 @@ describe('NewMenuComponent', () => {
expect(spy).toHaveBeenCalled();
})
+ describe('should test getFunctionCDselectData method2',()=>{
+ it('testing getFunctionCDselectData',()=>{
+ let spy= spyOn(adminService,'getFunctionCdList').and.returnValue(Observable.throw({status:404}))
+ component.getFunctionCDselectData();
+ expect(spy).toHaveBeenCalled();
+ })
+ })
+
it('should test updateFnMenu method',()=>{
component.menu.label!=null;
component.updateFnMenu();