-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Unsupported CVA message more specific #3341
Comments
Hi @GrzegorzKaczan, thanks for the request. Could you explain your use-case? Normally, as a developer you will be using |
Sure. Our internal framework that has few custom CVAs had a different pattern for the onChange callback, namely using |
I see. That makes sense. I'll update the error message with next release. |
v14.2.0 has been released and contains a fix for the issue. Feel free to reopen the issue or to submit a new one if you meet any problems. |
Currently when CVA on which
ngMocks.change/touch
is run, tests whether callback function exists within the component. Those need to have very specific names. Like one of:ng-mocks/libs/ng-mocks/src/lib/mock-helper/cva/mock-helper.change.ts
Line 56 in 33da7c0
Would be good to extend the generic error message thrown to include those as its not obvious just from the error message below why exactly is certain CVA unsupported.
ng-mocks/libs/ng-mocks/src/lib/mock-helper/cva/mock-helper.change.ts
Line 80 in 33da7c0
Proposal:
Unsupported type of ControlValueAccessor: CVA component is missing required onChange callback. Was looking for either of these: ${keys.join()}
Obviously similar for
touch
.The text was updated successfully, but these errors were encountered: