Explain how ngOnChange hook behaves during unit tests #44072
Labels
area: docs
Related to the documentation
area: testing
Issues related to Angular testing features, such as TestBed
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone
Description
There seems to be a lot of people unaware of the unexpected behaviour of ngOnChange not being called when doing something like:
It is not obvious that ngOnChange will not be called when doing this, therefore please provide a clarification in the testing docs.
It would be great to also provide some strategy/strategies for how to test a component which depends on the ngOnChange hook.
Issue taken from angular/angular.io#3277
Relating to #9866
What is the affected URL?
No response
Please provide the steps to reproduce the issue
No response
Please provide the expected behavior vs the actual behavior you encountered
No response
Please provide a screenshot if possible
No response
Please provide the exception or error you saw
No response
Is this a browser-specific issue? If so, please specify the device, browser, and version.
No response
The text was updated successfully, but these errors were encountered: