diff options
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts | 26 |
1 files 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 - }) + }); }); |