Created
December 4, 2019 17:25
-
-
Save lkopacz/c1ec3ff2c85fe80dd7973666007c305a to your computer and use it in GitHub Desktop.
using within
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
import { render, within } from "@testing-library/react"; | |
it("testing things", () => { | |
const { container } = render( | |
<Component prop={someProp} /> | |
); | |
const { getByText } = within(container.querySelector(".some-class")); | |
const getParent = getByText("2010").parentElement; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment