-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
ngModelChange not triggered for checkbox input when clicked in unit test #17104
Comments
Your test could look like
http://plnkr.co/edit/gik3X33OMBZyJbhvvmb1?p=preview Without it when you are calling |
@alexzuza thanks! |
@alexzuza could you explain or link to an explanation of what fixture.detectChanges(); // initialize controls
tick(); // wait registration controls does? Perhaps a good answer: Not read this but seems to have details |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
Using a component that has a checkbox input element:
In my unit test I'm calling
click
on the input:but
ngModelChange
is not triggered.When running the app and clicking the checkbox the event is triggered the event is also triggered if the input is not inside a form.
Expected behavior
ngModelChange
should be triggered during test and runtime.Minimal reproduction of the problem with instructions
http://plnkr.co/edit/F3KdX82dSIL6wI9fF8Fd?p=preview
What is the motivation / use case for changing the behavior?
The behavior for test and runtime should be identical
Please tell us about your environment:
OS: OSX 10.12.5
Browser: all, tested chrome 58 and Safari 10.1.1
Language: TypeScript 2.*
Node (for AoT issues):
node --version
=The text was updated successfully, but these errors were encountered: