From 2c60f25d21f4e17b8f94681a1e133d80fcb592c2 Mon Sep 17 00:00:00 2001 From: jonsadev Date: Mon, 21 Jan 2019 10:25:17 -0700 Subject: [PATCH] web-ui: Fix ticker.component.spec --- .../ticker/ticker.component.spec.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/web-ui/src/app/components/ticker/ticker.component.spec.ts b/web-ui/src/app/components/ticker/ticker.component.spec.ts index 72b804f..169de88 100644 --- a/web-ui/src/app/components/ticker/ticker.component.spec.ts +++ b/web-ui/src/app/components/ticker/ticker.component.spec.ts @@ -1,14 +1,33 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { TickerComponent } from './ticker.component'; +import { ExplorerCurrencyPipe } from '../../pipes/explorer-currency.pipe'; + +import { TranslateModule } from '@ngx-translate/core'; + +import { TickerService } from '../../services/ticker.service'; +import { Observable } from 'rxjs'; describe('TickerComponent', () => { let component: TickerComponent; let fixture: ComponentFixture; + const tickerServiceSpy: jasmine.SpyObj = jasmine.createSpyObj('TickerService', ['get']); + beforeEach(async(() => { + tickerServiceSpy.get.and.returnValue(Observable.create()); + TestBed.configureTestingModule({ - declarations: [ TickerComponent ] + declarations: [ + TickerComponent, + ExplorerCurrencyPipe + ], + imports: [ + TranslateModule.forRoot() + ], + providers: [ + { provide: TickerService, useValue: tickerServiceSpy } + ] }) .compileComponents(); }));