Although UI interaction testing is probably part of end-to-end testing, we'll look at how to test basic user interaction with your components. In this topic, we'll test the efforts component when the user clicks on one of the buttons to add effective effort hours.
Let's add a new test to our existing efforts component test file, located on the path src/app/efforts/efforts/efforts.component.spec.ts:
it('should add one day of effective efforts on button click', () => {
// Given
const day = 3600000 * 8;
const component = fixture.componentInstance;
component.efforts = {
estimated: 0,
effective: 0
};
const addDayButton = fixture.debugElement
.queryAll(By.css('button'))[2];
spyOn(component.outEffortsChange, 'emit');
// When
addDayButton.triggerEventHandler(&apos...