import { DebugElement } from '@angular/core' ; import { tick , ComponentFixture } from '@angular/core/testing' ; export * from './activated-route-stub' ; export * from './router-link-directive-stub' ; export function advance ( f ) { tick ( ) ; f . detectChanges ( ) ; } interface IButtonClickEvent { button : number ; } export const ButtonClickEvents = { left : { button : 0 } , right : { button : 2 } , } ; export function click ( el , eventObj = ButtonClickEvents . left ) { if ( el instanceof HTMLElement ) { el . click ( ) ; } else { el . triggerEventHandler ( 'click' , eventObj ) ; } }