diff options
author | Sunder Tattavarada <statta@research.att.com> | 2020-07-07 17:08:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-07-07 17:08:45 +0000 |
commit | c8b1e441251223784574980a179dfb22217feecf (patch) | |
tree | 33d35ec8c03256f8649d646a746cb13895b16c82 | |
parent | 749ef2748733dbac79e537f7ab1184950a307acc (diff) | |
parent | 492b99880c5df80c22e01c49deb02a18dd94d852 (diff) |
Merge "Some modifications in sidebar components"
-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 - }) + }); }); |