|
@ -1,14 +1,33 @@ |
|
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
|
|
|
|
|
|
|
import { TickerComponent } from './ticker.component'; |
|
|
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', () => { |
|
|
describe('TickerComponent', () => { |
|
|
let component: TickerComponent; |
|
|
let component: TickerComponent; |
|
|
let fixture: ComponentFixture<TickerComponent>; |
|
|
let fixture: ComponentFixture<TickerComponent>; |
|
|
|
|
|
|
|
|
|
|
|
const tickerServiceSpy: jasmine.SpyObj<TickerService> = jasmine.createSpyObj('TickerService', ['get']); |
|
|
|
|
|
|
|
|
beforeEach(async(() => { |
|
|
beforeEach(async(() => { |
|
|
|
|
|
tickerServiceSpy.get.and.returnValue(Observable.create()); |
|
|
|
|
|
|
|
|
TestBed.configureTestingModule({ |
|
|
TestBed.configureTestingModule({ |
|
|
declarations: [ TickerComponent ] |
|
|
declarations: [ |
|
|
|
|
|
TickerComponent, |
|
|
|
|
|
ExplorerCurrencyPipe |
|
|
|
|
|
], |
|
|
|
|
|
imports: [ |
|
|
|
|
|
TranslateModule.forRoot() |
|
|
|
|
|
], |
|
|
|
|
|
providers: [ |
|
|
|
|
|
{ provide: TickerService, useValue: tickerServiceSpy } |
|
|
|
|
|
] |
|
|
}) |
|
|
}) |
|
|
.compileComponents(); |
|
|
.compileComponents(); |
|
|
})); |
|
|
})); |
|
|