import { async , ComponentFixture , TestBed } from '@angular/core/testing' ; import { RouterTestingModule } from '@angular/router/testing' ; import { EventService } from '@core/event.service' ; import { MockComponent } from 'ng2-mock-component' ; import { of } from 'rxjs' ; import { Event } from '../../event' ; import { RegionInfoComponent } from './region-info.component' ; describe ( 'RegionInfoComponent' , ( ) => { let component ; let fixture ; beforeEach ( async ( ( ) => { const eventServiceStub = { event$ : of ( new Event ( { } ) ) } ; TestBed . configureTestingModule ( { declarations : [ RegionInfoComponent , MockComponent ( { inputs : [ 'event' ] , selector : 'region-info-display' } ) ] , imports : [ RouterTestingModule ] , providers : [ { provide : EventService , useValue : eventServiceStub } ] } ) . compileComponents ( ) ; fixture = TestBed . createComponent ( RegionInfoComponent ) ; component = fixture . componentInstance ; fixture . detectChanges ( ) ; } ) ) ; it ( 'should create' , ( ) => { expect ( component ) . toBeTruthy ( ) ; } ) ; } ) ;