8. Add test for the event emitter
In this section we will add tests for the AddAttendeeComponent's EventEmitter.
1. Add test to make sure the component emits an attendee
...
it('should emit an attendee', async(() => {
component.addAttendeeForm.controls.name.setValue('Duncan');
component.addAttendee.subscribe((attendee: Attendee) => {
expect(attendee.name).toEqual('Duncan');
});
component.submit();
}));
...
StackBlitz Link
Last updated