diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts')
-rw-r--r-- | ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/header/header.service.spec.ts | 26 |
1 files changed, 22 insertions, 4 deletions
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 c93a83fb..c6a2de49 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,17 +1,35 @@ import { TestBed } from '@angular/core/testing'; -import { HttpClientModule } from '@angular/common/http'; +import { HttpClientModule, HttpClient, HttpXhrBackend } from '@angular/common/http'; import { HeaderService } from './header.service'; +import { environment } from 'src/environments/environment'; +import { HttpTestingController } from '@angular/common/http/testing'; +import { get } from 'http'; + describe('HeaderService', () => { - beforeEach(() => TestBed.configureTestingModule({ - imports:[HttpClientModule] - })); + let service: HeaderService; + let httpMock: HttpTestingController; + + beforeEach(() =>{ TestBed.configureTestingModule({ + imports:[HttpClientModule], + providers: [HttpClient, HeaderService, HttpTestingController], + }); + service = TestBed.get(HeaderService); + httpMock = TestBed.get(HttpTestingController); +}); it('should be created', () => { const service: HeaderService = TestBed.get(HeaderService); expect(service).toBeTruthy(); }); + + it('should test getTopMenuItems', () => { + service.getTopMenuItems().subscribe((res) => { + expect(res).toBe(environment.getTopMenu); + }); + }) + }); |