diff options
author | Indrijeet kumar <indriku1@in.ibm.com> | 2020-04-17 04:27:42 +0530 |
---|---|---|
committer | Indrijeet kumar <indriku1@in.ibm.com> | 2020-04-17 04:27:50 +0530 |
commit | af61c7cf9edb03642e067a091573cef6d444c56a (patch) | |
tree | 7b223a5dbd5902fd7866f8107146033e6f4de836 /ecomp-sdk/epsdk-app-overlay/src/main | |
parent | 9ac990d143c7eb57424609a091308245d3072466 (diff) |
some more test cases in menus service
some more test cases in menus service
Issue-ID: PORTAL-813
Change-Id: I2446d40b6f23d6fefd3745ec68a8d9614d977274
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts index c39dcdc0..8d5c6637 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/menus/menus.service.spec.ts @@ -53,7 +53,7 @@ describe('MenusService', () => { let component:MenusService; let service:AdminService; - var stubData={"data":{"active":"data2"}} + var stubData={"data":['{"active":"data"}','{"separator":"data1"}']}; beforeEach(() =>{ TestBed.configureTestingModule({ @@ -69,6 +69,24 @@ describe('MenusService', () => { expect(component).toBeTruthy(); }); + // it('should test getTotalRowCount method',()=>{ + // component.getTotalRowCount(); + // }) + + it('should test updateStatus method',()=>{ + component['updateStatus']('N'); + }) + + it('should test updateBooleanValue method',()=>{ + component['updateBooleanValue'](true); + component['updateBooleanValue'](false); + }) + + it('should test updateParentNameToID method',()=>{ + component.parentList=[{'name':'data'}]; + component['updateParentNameToID']('data'); + }) + it('should test menu',()=>{ console.log(component.menu); expect(component.menu.action).toEqual(null); @@ -90,4 +108,27 @@ describe('MenusService', () => { expect(spy).toHaveBeenCalled(); }) + + it('should test delete method',()=>{ + let spy=spyOn(service,'deleteMenu').and.returnValue(Observable.of("")); + component.delete(stubData); + expect(spy).toHaveBeenCalled(); + }) + + it('should test error part of delete method',()=>{ + let spy=spyOn(service,'deleteMenu').and.returnValue(Observable.throw({status:404})); + component.delete(stubData); + expect(spy).toHaveBeenCalled(); + }) + + it('should test getParentList method',()=>{ + component.getParentList("getParentList"); + expect(component.parentList).toEqual("getParentList"); + }) + + it('should test get method',()=>{ + let spy=spyOn(service,'getFnMenuItems').and.returnValue(Observable.of()); + component.get(); + expect(spy).toHaveBeenCalled(); + }) }); |