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
defer: change detection & tick doesn't render deferred component in unit test #53686
Comments
There are some utilities to make testing deferred blocks easier: https://angular.dev/guide/defer#testing |
@crisbeto These utilities force me to manually trigger the defer process when instead Angular should trigger this process. |
|
@JoostK I tried using |
I digged into this a bit more and found that it comes down to how TestBed.configureTestingModule({
// ...
deferBlockBehavior: DeferBlockBehavior.Playthrough,
}); Doing so does then actually work with |
Yeap, that was the issue. Seems like the documentation needs improvement on Deferrable Views / Testing |
I think it's fair to question whether // cc @jessicajaniuk @AndrewKushnir |
I was certainly surprised by the current behavior, I'd expected the opposite as well. |
This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686
This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686
…angular#53956) This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686 PR Close angular#53956
…angular#53956) This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686 PR Close angular#53956
…angular#53956) This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686 PR Close angular#53956
…angular#53956) This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686 PR Close angular#53956
…angular#53956) This inverts the default behavior of test bed to use playthrough for defer blocks instead of manual. fixes: angular#53686 PR Close angular#53956
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. |
Which @angular/* package(s) are the source of the bug?
core
Description
In a unit test, if
@defer
is conditional on a variable, change detection andtick
have no effect infakeAsync
.Please provide a link to a minimal reproduction of the bug
https://github.com/GeorgeHulpoi/ng-defer-testing-bug
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run
ng version
)Anything else?
No response
The text was updated successfully, but these errors were encountered: