Added test case for role-function-component 63/100663/1
authorRupinder <rupinsi1@in.ibm.com>
Thu, 23 Jan 2020 10:04:33 +0000 (15:34 +0530)
committerRupinder <rupinsi1@in.ibm.com>
Thu, 23 Jan 2020 10:09:23 +0000 (15:39 +0530)
Written test case for role-functions component

Issue-ID: PORTAL-808
Change-Id: I34e29fe8ddd32534deccf31c18d0bee797855fe9
Signed-off-by: Rupinder <rupinsi1@in.ibm.com>
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts

index a03f2e7..2439699 100644 (file)
@@ -1,6 +1,8 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { RoleFunctionsComponent } from './role-functions.component';
+import { AdminService } from '../admin.service';
+import { inject } from '@angular/core/testing';
 
 describe('RoleFunctionsComponent', () => {
   let component: RoleFunctionsComponent;
@@ -8,8 +10,8 @@ describe('RoleFunctionsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RoleFunctionsComponent ]
-    })
+      declarations: [ RoleFunctionsComponent ] 
+    }) 
     .compileComponents();
   }));
 
@@ -22,4 +24,9 @@ describe('RoleFunctionsComponent', () => {
   it('should create', () => {
     expect(component).toBeTruthy();
   });
+
+it('should test getDismissReason function', inject([AdminService],(adminservice) => {
+    component.getRoleFunctions();
+    expect(adminservice.getRoleFunctionsList).toHaveBeenCalled();
+  }));
 });