-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Bug: InputSignal not working when using NgMocks on a component imported from an external library #9698
Comments
have the same problem |
@mishahrokhola Did you find any workaround? |
@iamkinetic no. The only 1 thing is not to mock the component |
@satanTime Do you think it's something we could try to fix (and create a PR if we find a fix)? Do you have any pointer at where in the code we would have to look? |
Same Problem |
We are unfortunately seeing the same thing with an internal library using input signals and mocking its components in our consuming projects unit tests |
Same here |
I think there is the same kind of problem when using The error here : (The same output mock with the same component but internal in the application will work) |
Description of the bug
MockComponent on component imported from an external library does not work with InputSignal.
An example of the bug
This is the simplified imported component definition:
Used like this:
The
isInProgress
is using the@Input()
decorator and is correctly working/rendering.The isDisabled is a signal input and doesn't seem to be correctly rendered/working.
If I remove the [IsDisabled]="true" from the html, the page renders correctly and the unit test are ok.
If I copy the component from the library directly in my angular project, the InputSignal is correctly working with MockComponent. Is something missing from the external library or is MockComponent not able to read the InputSignal from an exported component?
My unit test are using karma/jasmine (still using TestBed). The project itself is correctly running and the binding on the InputSignal is working outside of the unit tests.
The components library and my project are both using Angular 18 and i'm using ngMocks latest version.
The text was updated successfully, but these errors were encountered: