From 1b3effd132195b24045c81ca14696cbe3e07cf69 Mon Sep 17 00:00:00 2001 From: jonsadev Date: Mon, 21 Jan 2019 10:21:55 -0700 Subject: [PATCH] web-ui: Fix richest-addresses.component.spec --- .../richest-addresses.component.spec.ts | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/web-ui/src/app/components/richest-addresses/richest-addresses.component.spec.ts b/web-ui/src/app/components/richest-addresses/richest-addresses.component.spec.ts index e58bd15..227e8dc 100644 --- a/web-ui/src/app/components/richest-addresses/richest-addresses.component.spec.ts +++ b/web-ui/src/app/components/richest-addresses/richest-addresses.component.spec.ts @@ -1,14 +1,42 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { RichestAddressesComponent } from './richest-addresses.component'; +import { ExplorerCurrencyPipe } from '../../pipes/explorer-currency.pipe'; + +import { InfiniteScrollModule } from 'ngx-infinite-scroll'; +import { TranslateModule } from '@ngx-translate/core'; + +import { BalancesService } from '../../services/balances.service'; +import { TickerService } from '../../services/ticker.service'; +import { Observable } from 'rxjs'; + +import { NO_ERRORS_SCHEMA, } from '@angular/core'; describe('RichestAddressesComponent', () => { let component: RichestAddressesComponent; let fixture: ComponentFixture; + const balancesServiceSpy: jasmine.SpyObj = jasmine.createSpyObj('BalancesService', ['getHighest']); + const tickerServiceSpy: jasmine.SpyObj = jasmine.createSpyObj('TickerService', ['get']); + beforeEach(async(() => { + balancesServiceSpy.getHighest.and.returnValue(Observable.create()); + tickerServiceSpy.get.and.returnValue(Observable.create()); + TestBed.configureTestingModule({ - declarations: [ RichestAddressesComponent ] + declarations: [ + RichestAddressesComponent, + ExplorerCurrencyPipe + ], + imports: [ + InfiniteScrollModule, + TranslateModule.forRoot() + ], + providers: [ + { provide: BalancesService, useValue: balancesServiceSpy }, + { provide: TickerService, useValue: tickerServiceSpy } + ], + schemas: [NO_ERRORS_SCHEMA] }) .compileComponents(); }));