Created
March 28, 2020 21:55
-
-
Save paigen11/31204d763943df6bccc7dad88502582b to your computer and use it in GitHub Desktop.
Example of using parentElement to access a DOM element a level above the targeted element in React Testing Library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = component.queryByPlaceholderText(componentText); | |
const enter = input.parentElement.querySelector('.anticon-plus'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment