import { async , ComponentFixture , TestBed } from '@angular/core/testing' ; import { TokenPreviewComponent } from './token-preview.component' ; import { AltcoinIoCommonModule } from "../../common/common.module" ; import { CommonModule } from "@angular/common" ; import { FlexLayoutModule } from "@angular/flex-layout" ; import { NgxChartsModule } from "@swimlane/ngx-charts" ; import { QuoteService } from "../../services/quote.service" ; import { BaseRequestOptions , ConnectionBackend , Http , RequestOptions } from "@angular/http" ; import { MockBackend } from "@angular/http/testing" ; import { MatCard , MatCardModule } from '@angular/material' ; import { BtcCoinModel } from "../../models/coins/btc-coin.model" ; describe ( 'TokenPreviewComponent' , ( ) => { let component ; let fixture ; let originalTimeout ; beforeEach ( ( ( ) => { TestBed . configureTestingModule ( { declarations : [ TokenPreviewComponent ] , imports : [ CommonModule , AltcoinIoCommonModule , FlexLayoutModule , NgxChartsModule , MatCardModule ] , providers : [ MockBackend , BaseRequestOptions , { provide : Http , useFactory : ( backend , defaultOptions ) => { return new Http ( backend , defaultOptions ) ; } , deps : [ MockBackend , BaseRequestOptions ] } , QuoteService , ] , } ) . compileComponents ( ) ; fixture = TestBed . createComponent ( TokenPreviewComponent ) ; component = fixture . componentInstance ; component . token = new BtcCoinModel ( ) ; spyOn ( component , "ngOnInit" ) ; fixture . detectChanges ( ) ; } ) ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } , 60000 ) ; } ) ;