summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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")
+ })
});