File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ type Props = {
1616 onCompleted ?: ( data : string ) => void ;
1717 placeholder ?: string ;
1818 value ?: string ;
19+ dataCy ?: string ;
1920} ;
2021
2122const ReactInputVerificationCode = ( {
@@ -25,6 +26,7 @@ const ReactInputVerificationCode = ({
2526 onCompleted = ( ) => { } ,
2627 placeholder = '·' ,
2728 value : pValue ,
29+ dataCy = 'verification-code'
2830} : Props ) => {
2931 const emptyValue = new Array ( length ) . fill ( placeholder ) ;
3032
@@ -197,6 +199,7 @@ const ReactInputVerificationCode = ({
197199 onBlur = { onInputBlur }
198200 // needed for styling
199201 activeIndex = { activeIndex }
202+ data-cy = { `${ dataCy } -otc-input` }
200203 />
201204
202205 { itemsRef . map ( ( ref , i ) => (
@@ -209,6 +212,7 @@ const ReactInputVerificationCode = ({
209212 value [ i ] !== placeholder ? 'is-filled' : ''
210213 } ${ i === activeIndex ? 'is-active' : '' } `}
211214 onFocus = { onItemFocus ( i ) }
215+ data-cy = { `${ dataCy } -${ i } -item` }
212216 >
213217 { value [ i ] || placeholder }
214218 </ Item >
You can’t perform that action at this time.
0 commit comments