My Angular 5 component uses typeahead directive of ngx-bootstrap, like this:
<input [(ngModel)]="inputted"
[typeahead]="days"
(typeaheadOnSelect)="select($event)"
class="form-control">
Now I want to test that my component does what is expected when the user selects an item in the typeahead. I need to simulate the typeahead directive's typeaheadOnSelect output. How can I access the directive in my unit test, to manually emit a typeaheadOnSelect event? This far I have come to this point:
const elem: DebugElement = fixture.debugElement.query(By.css('input'));
which gives me the input element. How do I find the underlying typeahead directive from there?