summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authorLorraine Welch <lb2391@att.com>2020-04-15 23:19:12 +0000
committerGerrit Code Review <gerrit@onap.org>2020-04-15 23:19:12 +0000
commit9ac990d143c7eb57424609a091308245d3072466 (patch)
tree222ad3901f53cb6eac8264b99d9b4fb137edb0e5 /ecomp-sdk
parentd6c83ea37b206ebf37c3dbc7f8e7922bfba3e664 (diff)
parent7e62a2b29498552a31fa1e244f1cfb94fe642364 (diff)
Merge "test cases written in new-role-function comp"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts46
1 files changed, 40 insertions, 6 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts
index ecc0947d..7ef63baf 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/new-role-function/new-role-function.component.spec.ts
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modification Copyright © 2020 IBM.
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -41,7 +43,12 @@ import { NewRoleFunctionComponent } from './new-role-function.component';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
+import { NgbActiveModal, NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import {MatRadioModule } from '@angular/material';
+import { RouterTestingModule } from '@angular/router/testing';
+import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component';
+import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
+import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component';
describe('NewRoleFunctionComponent', () => {
let component: NewRoleFunctionComponent;
@@ -50,10 +57,25 @@ describe('NewRoleFunctionComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
schemas:[CUSTOM_ELEMENTS_SCHEMA],
- declarations: [ NewRoleFunctionComponent ],
- imports:[FormsModule,HttpClientTestingModule],
+ declarations: [
+ NewRoleFunctionComponent,
+ ConfirmationModalComponent,
+ InformationModalComponent
+ ],
+ imports:[
+ FormsModule,
+ HttpClientTestingModule,
+ MatRadioModule,
+ RouterTestingModule,
+ NgbModule.forRoot()
+ ],
providers:[NgbActiveModal]
})
+ TestBed.overrideModule(BrowserDynamicTestingModule,{
+ set:{
+ entryComponents:[ConfirmationModalComponent,InformationModalComponent]
+ }
+ })
.compileComponents();
}));
@@ -63,7 +85,19 @@ describe('NewRoleFunctionComponent', () => {
fixture.detectChanges();
});
- // it('should create', () => {
- // expect(component).toBeTruthy();
- // });
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+ it('should test ngOnInit method',()=>{
+ component.ngOnInit();
+ })
+
+ it('should test saveRoleFunction method',()=>{
+ component.saveRoleFunction();
+ })
+
+ it('should test openConfirmationModal method',()=>{
+ component.openConfirmationModal("indrijeet","kumar")
+ })
});