Hi i am new to react and testing using jest. i want to select an input element with its id attribute.
below is the html
<code><input id="input-id" name="protocol" type="radio" value="somevalue">
</code>
<code><input id="input-id" name="protocol" type="radio" value="somevalue">
</code>
<input id="input-id" name="protocol" type="radio" value="somevalue">
how can i select this input.
i have tried below,
<code>userEvent.click(screen.getByRole('input').hasAttribute('id', 'input-id'));
</code>
<code>userEvent.click(screen.getByRole('input').hasAttribute('id', 'input-id'));
</code>
userEvent.click(screen.getByRole('input').hasAttribute('id', 'input-id'));
but this doesnt work. could someone help me with this.thanks.