diff options
author | 2020-04-01 22:22:02 +0530 | |
---|---|---|
committer | 2020-04-01 22:22:09 +0530 | |
commit | 7932700eef293868d4112e881b37a297a3c54ac9 (patch) | |
tree | 56c8bfa290063eed9fe981ed1c3abbed1e17d854 /ecomp-sdk | |
parent | 7d3ad2425c0a774179ddb522e741d977c3bcf992 (diff) |
test cases written in role-functions comp
test cases written in role-functions component
Issue-ID: PORTAL-813
Change-Id: Ifbb950e4c993037b93962ccf161e5798a6948652
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts index e761ada5..9cb908dd 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/role-functions/role-functions.component.spec.ts @@ -43,11 +43,12 @@ import { RoleFunctionsComponent } from './role-functions.component'; import { CUSTOM_ELEMENTS_SCHEMA} from '@angular/core'; import { HttpClientTestingModule } from '@angular/common/http/testing'; import { RdpModule } from 'portalsdk-tag-lib'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FormsModule} from '@angular/forms'; import { UserService } from 'src/app/shared/services/user/user.service'; import { AdminService } from '../admin.service'; -import { MatSelectModule, MatAutocompleteModule } from '@angular/material'; +import { MatSelectModule} from '@angular/material'; import { Observable } from 'rxjs'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('RoleFunctionsComponent', () => { let component: RoleFunctionsComponent; @@ -59,13 +60,12 @@ describe('RoleFunctionsComponent', () => { TestBed.configureTestingModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], declarations: [ RoleFunctionsComponent ], - imports: [HttpClientTestingModule, + imports: [HttpClientTestingModule,BrowserAnimationsModule, RdpModule, FormsModule, - // MatSelectModule, ], providers:[MatSelectModule] - }) + }) .compileComponents(); })); @@ -80,27 +80,20 @@ describe('RoleFunctionsComponent', () => { adminService=TestBed.get(AdminService); }); -// it('should create', () => { -// expect(component).toBeTruthy(); -// }); + it('should create', () => { + expect(component).toBeTruthy(); + }); -// describe('test for subscribe in ngOnInit',()=>{ -// it('should test ngOnInit method',()=>{ -// let spy=spyOn(userService,'getFunctionalMenuStaticDetailSession').and.returnValue(Observable.of('you object')); -// component.ngOnInit(); -// expect(spy).toHaveBeenCalled(); -// }) -// }) -// it('Admin service injection check', inject([AdminService],(injectService:AdminService) =>{ -// expect(injectService).toBe(adminService); -// })); + describe('test for subscribe in ngOnInit',()=>{ + it('should test ngOnInit method',()=>{ + let spy=spyOn(userService,'getFunctionalMenuStaticDetailSession').and.returnValue(Observable.of('you object')); + component.ngOnInit(); + expect(spy).toHaveBeenCalled(); + }) + }) + it('Admin service injection check', inject([AdminService],(injectService:AdminService) =>{ + expect(injectService).toBe(adminService); + })); -// // describe('test subscribe in getRoleFunctions',()=>{ -// // it('should test getRoleFunctions method',()=>{ -// // let spy=spyOn(adminService,'getRoleFunctionList').and.returnValue(Observable.of('you object')); -// // component.getRoleFunctions(); -// // expect(spy).toHaveBeenCalled(); -// // }) -// // }) - });
\ No newline at end of file +}); |