How to mock a child component that don't implemets ControlValueAccesor

Discussão em 'Angular' iniciado por IKERAGI, Março 13, 2025.

  1. IKERAGI

    IKERAGI Guest

    I have a child component that is a dropdown select and i need to add formControlName from ReactiveForms but this dropdown is not implementing the ControlValueAccesor. When i go to test with Karma the following error appears: TypeError: dir.valueAccessor.registerOnTouched is not a function. I tried to mock with jasmine but error continues appearing.

    PD: i can't modify the child component

    Continue reading...

Compartilhe esta Página