I want to test the functionality of my hide-show button in my Angular 2 app(Tests are written in Jasmine), so I need to check the value of the display
property of the relevant element. How can I get this property using Angular's debugElement
?
Test code:
let input = fixture.debugElement.query(By.css('input'));
expect(input.styles['visibility']).toBe('false');
I get the error: Expected undefined to be 'false'.
style
property. – Coliclet input = fixture.debugElement.query(By.css('input')).nativeElement
. – Ramsdell