diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2019-12-02 15:56:26 +0530 |
---|---|---|
committer | Arundathi Patil <arundpil@in.ibm.com> | 2019-12-02 15:56:32 +0530 |
commit | 60a2528079050f728c7aec9abed4041bbad6c106 (patch) | |
tree | 9777ac6d47a411abc284c775d22878306c4b932e /ecomp-sdk/epsdk-app-overlay/src/main/webapp | |
parent | beabe647ed84f9a5fea3e9633267e713e19f3750 (diff) |
Spec file error fixes
Fixed multiple errors in multiple spec files which caused test case
failures
Issue-ID: PORTAL-416
Change-Id: I71f51a31301b7f2dc77a763b2799a4b665e596cd
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp')
6 files changed, 25 insertions, 4 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts index cbab9b18..02cfd6b6 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/layout/components/header/header.component.spec.ts @@ -38,6 +38,7 @@ 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 { HeaderComponent } from './header.component'; import { LayoutModule } from '../../layout.module'; @@ -52,6 +53,7 @@ describe('HeaderComponent', () => { LayoutModule, RouterTestingModule, TranslateModule.forRoot(), + HttpClientModule ], }) .compileComponents(); @@ -66,4 +68,10 @@ describe('HeaderComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + it('should test isToggled function', () => { + console.log(component.isToggled()); + document.getElementById("body").classList.add("push-right"); + expect(component.isToggled()).toBe(true); + }); }); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.spec.ts index b61e9c56..1907ed83 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/report-list.component.spec.ts @@ -3,6 +3,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatPaginatorModule } from '@angular/material/paginator'; import { MatSortModule } from '@angular/material/sort'; import { MatTableModule } from '@angular/material/table'; +import { MatIconModule } from '@angular/material/icon'; import { ReportListComponent } from './report-list.component'; @@ -18,6 +19,7 @@ describe('AllReportsComponent', () => { MatPaginatorModule, MatSortModule, MatTableModule, + MatIconModule ] }).compileComponents(); })); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.component.spec.ts index 7a864aca..f1d4c6ad 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.component.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.component.spec.ts @@ -1,4 +1,5 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { RouterTestingModule } from '@angular/router/testing' import { PagesComponent } from './pages.component'; @@ -8,7 +9,8 @@ describe('PagesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PagesComponent ] + declarations: [ PagesComponent ], + imports: [ RouterTestingModule ] }) .compileComponents(); })); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts index 0c8b8b06..dc987eff 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts @@ -1,9 +1,12 @@ import { TestBed } from '@angular/core/testing'; +import { HttpClientModule } from '@angular/common/http'; import { HeaderService } from './header.service'; describe('HeaderService', () => { - beforeEach(() => TestBed.configureTestingModule({})); + beforeEach(() => TestBed.configureTestingModule({ + imports:[HttpClientModule] + })); it('should be created', () => { const service: HeaderService = TestBed.get(HeaderService); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts index 065e6e56..6e8a3ba6 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/sidebar/sidebar.service.spec.ts @@ -36,11 +36,14 @@ * */ import { TestBed } from '@angular/core/testing'; +import { HttpClientModule } from '@angular/common/http'; import { SidebarService } from './sidebar.service'; describe('SidenavService', () => { - beforeEach(() => TestBed.configureTestingModule({})); + beforeEach(() => TestBed.configureTestingModule({ + imports: [HttpClientModule] + })); it('should be created', () => { const service: SidebarService = TestBed.get(SidebarService); diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/user/user.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/user/user.service.spec.ts index 9e7fd1c3..d6d659b9 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/user/user.service.spec.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/user/user.service.spec.ts @@ -1,9 +1,12 @@ import { TestBed } from '@angular/core/testing'; +import { HttpClientModule } from '@angular/common/http'; import { UserService } from './user.service'; describe('UserService', () => { - beforeEach(() => TestBed.configureTestingModule({})); + beforeEach(() => TestBed.configureTestingModule({ + imports:[HttpClientModule] + })); it('should be created', () => { const service: UserService = TestBed.get(UserService); |