I have an Angular 6 app and writing some unit tests trying to determine if an element is visible or not based solely on the boolean result of an *ngIf directive
*ngIf
Writing test case for *ngIf condition use toBeNull condition.
toBeNull
Try with below code, it works for me.
expect(fixture.debugElement.query(By.css('.header'))).toBeNull();