summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIndrijeet kumar <indriku1@in.ibm.com>2020-04-27 03:03:28 +0530
committerIndrijeet Kumar <indriku1@in.ibm.com>2020-04-26 22:45:59 +0000
commit4d1ac762a89617d59867661df153c4d40a59e8cc (patch)
tree6e9ed4523d8fa1f223e75863208ca6818a7013b0
parent8c193243356e909d0210036006aa9416c6455d00 (diff)
some test cases in sidebar component
some test cases in sidebar component Issue-ID: PORTAL-813 Change-Id: I3b3548e4727c889cac47c42ddf9dafe55c137c02 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.ts19
1 files changed, 15 insertions, 4 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 7f5a43fe..42c176bf 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
@@ -37,6 +37,7 @@
*
*
*/
+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core';
@@ -55,13 +56,15 @@ describe('SidebarComponent', () => {
let sidebarService: SidebarService;
var stubData1={
- "data":'{"data":"cachedRegions"}',
- "data2":'{"data2":"cachedRegions2"}'
+ "data":'"d"',
+ "data2":'"data2"'
};
-
+ var stubData2={
+ "data":'"d"',
+ "data2":'" "'
+ };
beforeEach(async(() => {
- let sidebarService: SidebarService;
TestBed.configureTestingModule({
imports: [
LayoutModule,
@@ -102,6 +105,14 @@ describe('SidebarComponent', () => {
})
})
+ //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';
component.addExpandClass('1');