Created
March 28, 2020 22:18
-
-
Save paigen11/9e5bb432477d5ff090c723c8bec7a165 to your computer and use it in GitHub Desktop.
Example of using previousSibling or nextSibling to target elements around a particular 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 keyToSelect = await component.findByText('key to select'); | |
userEvent.click(keyToSelect.previousSibling.firstChild.firstChild); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment