-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(core): properly handle the case where getSignalGraph is called on a componentless NodeInjector #60772
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
base: main
Are you sure you want to change the base?
Conversation
e2f18db
to
b7b93c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AleksanderBodurri I think that this change will need a test - without a test it is not clear under which conditions the assert starts to fail. And there is a risk that we accidentally refactor the code in a way that breaks dev tools again.
fa7bbf3
to
94d9e44
Compare
94d9e44
to
2a30cac
Compare
Good point 🙏 Added another test case for getSignalGraph that goes through the component-less NodeInjector case |
2a30cac
to
7b264ec
Compare
it('should return no nodes or edges for a NodeInjector that only has directives and no component', fakeAsync(() => { | ||
@Directive({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I acknoledge there are existing tests with the same pattern but I think we can simplify the test.
- dropping the
fakeAsync
- remove the
tick
that doesn't do much I believe - remove
compileComponents()
which isn't required here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouu nice, did this change recently? I could swear in the past these tests would fail without the tick.
Made the change. Will open a follow up PR for the other test cases in this file so as to not pollute this PR
… a componentless NodeInjector Previously this would throw an error on the assertLView when we try to discover the templateLView. Now this properly returns null for the template consumer and continues discovering other effects on the injector.
7b264ec
to
3683156
Compare
Previously this would throw an error on the assertLView when we try to discover the templateLView.
Now this properly returns null for the template consumer and continues discovering other effects on the injector.