Unit Tests - Unable to create component with mat-autocomplete

130 views Asked by At

I have a reactive form component that is built on 2 mat-autocomplete form control fields and a submit.

Basically, you search a keyword, and autocomplete functionality of the angular material (ng9) lists down a list of matching entries before you can select one.

Once you have selected you click the form group submits. The implementation is working fine, I have been trying hard to write unit tests for this component, however, I am unable to access fields because TestBed is unable to mock the component even with all the injected dependencies.

I have imported mat-AutoCompleteModule in the TestBed configurations before each. I honestly have not found any relevant links that I can refer to. I have a similar reactive form with two form control fields unit tested properly, the only difference here is that I am using Mat-Autocomplete in this form

enter image description here

0

There are 0 answers