import { ComponentRef , DebugElement } from '@angular/core' ; import { ComponentFixture } from '@angular/core/testing' ; export function getStarElement ( fixture , defaultElementIndex ) { const el = fixture . nativeElement as DebugElement ; return el . children [ defaultElementIndex ] ; } export function doClassesMatch ( resultClasses , expectedClasses ) { let classesMatch = true ; let currentClass = null ; for ( let i = 0 ; i < expectedClasses . length ; i ++ ) { currentClass = expectedClasses [ i ] ; classesMatch = resultClasses . contains ( currentClass ) ; if ( ! classesMatch ) { break ; } } return classesMatch ; } export function getElement ( fixture ) { const el = fixture . nativeElement as DebugElement ; return el ; }