diff options
author | Lorraine Welch <lb2391@att.com> | 2020-04-01 18:59:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-04-01 18:59:41 +0000 |
commit | e988e3da45deaaa827d8ac90217d595ac2042228 (patch) | |
tree | 4ce8fa8fe289c4b99a24f9b1dbaac5c8cb61d81a /ecomp-sdk/epsdk-app-overlay/src | |
parent | 174c6f17ef5f60a3035b6c18119d889c2c4deb9f (diff) | |
parent | 13027866754eeb10f4462dcc89d3fc76f51ea148 (diff) |
Merge "test cases written in roles component"
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts index 8af2689a..dcd637fc 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/roles/roles.component.spec.ts @@ -45,16 +45,34 @@ import { RolesComponent } from './roles.component'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { MatTableModule } from '@angular/material'; import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { UserService } from 'src/app/shared/services/user/user.service'; +import { Observable } from 'rxjs'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; +import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing'; describe('RolesComponent', () => { let component: RolesComponent; let fixture: ComponentFixture<RolesComponent>; + let userService: UserService; beforeEach(async(() => { TestBed.configureTestingModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [ RolesComponent ], - imports:[MatTableModule,HttpClientTestingModule] + declarations: [ + RolesComponent, + InformationModalComponent, + ], + imports:[ + MatTableModule, + HttpClientTestingModule, + NgbModule.forRoot() + ] + }) + TestBed.overrideModule(BrowserDynamicTestingModule,{ + set:{ + entryComponents:[InformationModalComponent] + } }) .compileComponents(); })); @@ -63,9 +81,25 @@ describe('RolesComponent', () => { fixture = TestBed.createComponent(RolesComponent); component = fixture.componentInstance; fixture.detectChanges(); + userService=TestBed.get(UserService); }); it('should create', () => { expect(component).toBeTruthy(); }); + + it('should test subscribe inside ngOnInit method',()=>{ + let spy=spyOn(userService,'getFunctionalMenuStaticDetailSession').and.returnValue(Observable.of('your data')) + component.ngOnInit(); + expect(spy).toHaveBeenCalled(); + }) + + it('should test delRoleConfirmPopUp method',()=>{ + component.delRoleConfirmPopUp('dummyargument'); + + }) + + // it('should test openAdoleModaldNewR method',()=>{ + // component.openAdoleModaldNewR('dummydata2') + // }) }); |