This is a suggestion for using data-testid in some HTML element as inputs
I give more context in the data-testid to be easier to target it.
For example: when multiple inputs are displayed, they all have data-testid="input". It is not helping to target it when testing. To target a specific input a data-testid with context is easier data-testid="input_name". For targeting all inputs with react testing library, it is better to target by role.
This is a suggestion for using data-testid in some HTML element as inputs I give more context in the data-testid to be easier to target it. For example: when multiple inputs are displayed, they all have
data-testid="input"
. It is not helping to target it when testing. To target a specific input a data-testid with context is easierdata-testid="input_name"
. For targeting all inputs with react testing library, it is better to target by role.