I have a structure like this:
<div data-test-locator="MyId">
<input value="some" type="checkbox" checked />
</div>
I need to test if the checkbox is checked. But how can I get it in the first place? I can get an element with a test id like this: getByTestId('MyId')
But how can I get its child input?
If you know the structure would not change, you can use firstChild
expect((getByTestId('MyId').firstChild).checked).toEqual(true)