From 492b99880c5df80c22e01c49deb02a18dd94d852 Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Mon, 15 Jun 2020 00:11:03 +0530 Subject: Some modifications in sidebar components some modifications in sidebar components Issue-ID: PORTAL-813 Change-Id: Iad3a258ec888d0c0f1390931134feafff18a1b9b Signed-off-by: Indrijeet Kumar --- .../components/sidebar/sidebar.component.spec.ts | 26 +++++++++------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts index 9bbcfc4e..eaa6a070 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts @@ -59,10 +59,6 @@ describe('SidebarComponent', () => { "data":'"d"', "data2":'"data2"' }; - var stubData2={ - "data":'"d"', - "data2":'" "' - }; beforeEach(async(() => { TestBed.configureTestingModule({ @@ -94,17 +90,15 @@ describe('SidebarComponent', () => { it('should validate on ngOnInit',()=>{ let spy=spyOn(sidebarService,'getLeftMenu').and.returnValue(Observable.of(stubData1)); component.ngOnInit(); + expect(component.isActive).toEqual(false); + expect(component.collapsed).toEqual(false); + expect(component.showMenu).toEqual(''); + expect(component.pushRightClass).toEqual('push-right'); + expect(component.leftParentData).toEqual(JSON.parse(component.result.data)); + expect(component.leftChildData).toEqual(JSON.parse(component.result.data2)); expect(spy).toHaveBeenCalled(); }) - }) - - //describe('should test ngOnInit if part',()=>{ - //it('should validate on ngOnInit',()=>{ - //let spy=spyOn(sidebarService,'getLeftMenu').and.returnValue(Observable.of(stubData2)); - // component.ngOnInit(); - //expect(spy).toHaveBeenCalled(); - //}) - //}) + }); it('should test addExpandClass if element and showMenu variable value are same', () => { component.showMenu= '1'; @@ -132,15 +126,15 @@ describe('SidebarComponent', () => { it('should test isToggled method',()=>{ expect(component.isToggled()).toBe(false); - }) + }); it('should test toggleSidebar method',()=>{ component.pushRightClass="kumar"; expect(component.toggleSidebar()).toBeUndefined; - }) + }); it('should test on onLoggedout method',()=>{ expect(localStorage.getItem('isLoggedin')).toBeFalsy - }) + }); }); -- cgit 1.2.3-korg