/**
 * Testing helpers
 */ import { TestBed , ComponentFixture } from '@angular/core/testing' ; export function selectElements ( element , selector ) { return [ ] . slice . call ( element . querySelectorAll ( selector ) ) ; } export function createGenericTestComponent < T > ( type , html ? , detectChanges = true ) { if ( html ) { TestBed . overrideComponent ( type , { set : { template : html } } ) ; } const fixture = TestBed . createComponent ( type ) ; if ( detectChanges ) { fixture . detectChanges ( ) ; } return fixture as ComponentFixture < T > ; }