I have a test that checks if a DOM part item has been removed by ngIf. When I check the DOM, by using: fixture.debugElement.query(By.css(".button-area")), resultit is either null, or DOM element.
If result- null, then the next test works fine. But if the test resultcontains an element, it does not just fail, it freezes the browser.
The test is as follows:
var result = fixture.debugElement.query(By.css(".button-area"))
expect(result).toBe(null)
I also tried expect(result).toEqual(null)and .toBeFalsy()that have the same result.
What is the correct way to check if the DOM element is deleted correctly?
UPDATE 1/23/2017
I found out that this problem is specified for the item returned:
fixture.debugElement.query(By.css(".button-area"))
It could be a mistake. angular 2 . document.getElementByClassName("button-area"), , .