#[SOLVED] how to test ngbTypeahead from ng-bootstrap?

1 messages · Page 1 of 1 (latest)

jade viper
#

Hello, i want to unit test the search function, from the first example here: https://ng-bootstrap.github.io/#/components/typeahead/examples
how to do it?
I tried something with .nativeElement.value = 'abc', but it doesn't see changes. How to test that kind of functions which are using Observables and which are declared in ngInit()?

jade viper
#

ok, i get it

#

you have to just run something like

text$.next('value') ; fixture.detectChanges();
in unit test to test what is inside search function