I want to access the first element with class "icon".
This is how the DOM looks:
<div class="parent">
<div data-testid="add">
<div class="info"></div>
<div class="action">
<div class="icon"/> // <== I want to access this
</div>
</div>
</div>
<div class="parent">
<div data-testid="add">
<div class="info"></div>
<div class="action">
<div class="icon"/>
</div>
</div>
</div>
How can I get the first div with class "icon"?
I have tried:
const element = queryAllByTestId('add')[0].querySelector(
'div'
)[1];
This gives element undefined.
