I'm using react-testing-libarary to test my react application. For some reason, I need to be able to find the element by id
and not data-testid
. There is no way to achieve this in the documentation.
Is there a way to achieve this?
I've the rendered output as:
const dom = render(<App />);
I'm looking for something in line of:
const input = dom.getElemenById('firstinput');
//or
const input = dom.getById('firstinput');