Is there a way to use read
and root
query options together?
#506
Unanswered
mattwilson1024
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I want to make assertions about values being passed down to a child component's inputs, I use the
read
option to grab a reference to the component instance, like this:I'm struggling to test a component that uses NgbModal, because it inserts the content dynamically to the end of the DOM (rather than the content being a child of the template for the component under test). In order to be able to reference that node "globally" I have found that I can pass the
root
option toquery
, like this:But it seems that it's not possible to use both at once. Is there a way to get a reference to a component instance but from the root? The following doesn't work and I'm not sure how else to go about it:
Beta Was this translation helpful? Give feedback.
All reactions