
Luis Antonio Gutiérrez Hernández
PreguntaA mi me funciono ejecutando directamente el metodo click del botón utilizando el tipo HTMLButtonElement.
it('Should display a text with IMC when I make click', () => { // Arrange const expectedMessage = 'overweight level 1'; component.person = new Person('Juan', 'Gonzalez', 28, 65, 1.52); const button: HTMLButtonElement = fixture.debugElement.query(By.css('button.imc-btn')).nativeElement; // Act button.click(); fixture.detectChanges(); // Assert expect(button.textContent).toContain(expectedMessage); });
¿Cual es la diferencia entre ese click() y el triggerEventHandler()?