diff options
author | Lorraine Welch <lb2391@att.com> | 2019-12-04 22:03:34 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-04 22:03:34 +0000 |
commit | 738fe125d60639c4b83a4e9cb020c85f4ec9e6e9 (patch) | |
tree | 3aa91a20cd136e9ee5759a9817920f7dc54c75ff /ecomp-sdk | |
parent | 039bc81b6abc3b3c399ab69f0a6968e9d4c0cc77 (diff) | |
parent | 423ddb1a5efb1f05cde7da8092ed990368737229 (diff) |
Merge "sidebar component spec- added unit test cases"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/sidebar/sidebar.component.spec.ts | 35 |
1 files changed, 34 insertions, 1 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 8dbcb615..6b53cae4 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 @@ -3,6 +3,8 @@ * ONAP Portal SDK * =================================================================== * Copyright © 2019 AT&T Intellectual Property. All rights reserved. + * + * Modification Copyright © 2019 IBM. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed @@ -38,11 +40,12 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateModule } from '@ngx-translate/core'; +import { HttpClientModule } from '@angular/common/http'; import { SidebarComponent } from './sidebar.component'; import { LayoutModule } from '../../layout.module'; -describe('SidebarComponent', () => { +fdescribe('SidebarComponent', () => { let component: SidebarComponent; let fixture: ComponentFixture<SidebarComponent>; @@ -52,6 +55,7 @@ describe('SidebarComponent', () => { LayoutModule, RouterTestingModule, TranslateModule.forRoot(), + HttpClientModule ], }) .compileComponents(); @@ -66,4 +70,33 @@ describe('SidebarComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should test addExpandClass if element and showMenu variable value are same', () => { + component.showMenu= '1'; + component.addExpandClass('1'); + expect(component.showMenu).toBe('0'); + }); + + it('should test addExpandClass if element and showMenu variable value are not same', () => { + component.showMenu= '0'; + component.addExpandClass('1'); + expect(component.showMenu).toBe('1'); + }); + + it('should test toggleCollapsed function', () => { + component.collapsed= true; + component.toggleCollapsed(); + expect(component.collapsed).toBe(false); + }); + + it('should test eventCalled function', () => { + component.isActive= true; + component.eventCalled(); + expect(component.isActive).toBe(false); + }); + + it('should test ngOnInit function', () => { + component.ngOnInit(); + }); + }); |