export const assertIcon = ( iconElement , iconName ? , iconColor ? , iconPrefix = 'ic' ) => { if ( ! iconElement ) { throw new Error ( 'Icon element is undefined' ) ; } if ( iconName ) { expect ( ( iconElement . firstChild as Element ) . getAttribute ( 'xlink:href' ) ) . toBe ( `#${ iconPrefix }-${ iconName }` ) ; } if ( iconColor ) { expect ( iconElement . classList . contains ( iconColor ) ) . toBe ( true ) ; } } ; export const assertFocus = ( element , isFocused = true ) => { const realIsFocused = document . activeElement === element ; if ( realIsFocused && ! isFocused ) { throw new Error ( 'Element is focused while it should not' ) ; } if ( ! realIsFocused && isFocused ) { throw new Error ( 'Element is not focused while it should be' ) ; } } ; export const assertCheck = ( item , checked = true ) => { const checkbox = item . querySelector ( 'input[type="checkbox"]' ) as HTMLInputElement | null ; expect ( checkbox ?. checked ) . toBe ( checked ) ; } ;