summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIndrijeet kumar <indriku1@in.ibm.com>2020-06-15 00:11:03 +0530
committerIndrijeet kumar <indriku1@in.ibm.com>2020-06-15 00:11:17 +0530
commit492b99880c5df80c22e01c49deb02a18dd94d852 (patch)
treeb5d5308c9ac62ef964bda804edf6ed7997efda23
parent88a56a8071697d2a7dfa7db7e32c8a496218fb70 (diff)
Some modifications in sidebar components
some modifications in sidebar components Issue-ID: PORTAL-813 Change-Id: Iad3a258ec888d0c0f1390931134feafff18a1b9b Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts26
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
- })
+ });
});