I need some help to get my code coverage up. I have this function in my ts file and need to understand how to have this if statement execute.
setWidth(): void {
let maxHeight = 0;
document.querySelectorAll<HTMLElement>(`.body`).forEach(element => {
if (element.offsetHeight > maxHeight){
maxHeight = element.offsetHeight;
}
});
I am not clear on how I would get the forEach to execute in my spec.ts file.