devfolioco / react-otp-input

:heavy_check_mark: OTP Input Component for React
http://devfolioco.github.io/react-otp-input
MIT License
663 stars 426 forks source link

Add data attributes for test support #296

Closed causztic closed 3 years ago

causztic commented 3 years ago

This PR aims to add data-cy support for cypress E2E tests, and data-testid for react-testing-library tests.

Am using this library right now, but with my E2E tests I had to target aria-label which is not very resilient to changes.

Without data attributes set in the demo:

Screenshot 2021-06-23 at 11 27 49 PM
apollonian commented 3 years ago

Thank you, @causztic!

apollonian commented 3 years ago

@all-contributors please add @causztic for code

allcontributors[bot] commented 3 years ago

@apollonian

I've put up a pull request to add @causztic! :tada: