Closed aleksandrmaksimoviclt closed 3 years ago
can you tell elaborately like is it for testing purpose?
+1 on this
To create a snapshot test, we need to add a custom prop data-test-id
to the element.
But this is just one scenario; actually, it would be nice to have support for other custom additional props.
<OtpInput numInputs={6} testProp="testprop-" />
We then able to select inputs programatically in preferred test tools/libraries:testprop-1
- first inputtestprop-2
- second inputtestprop-3
- third inputtestprop-4
- fourth inputtestprop-5
- fifth inputtestprop-6
- sixth input