最佳答案
I'm using the getByTestId
function in React Testing Library:
const button = wrapper.getByTestId("button");
expect(heading.textContent).toBe("something");
Is it possible / advisable to search for HTML elements instead? So something like this:
const button = wrapper.getByHTML("button");
const heading = wrapper.getByHTML("h1");