File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -722,10 +722,13 @@ describe('Select.Basic', () => {
722
722
it ( 'combobox could customize input element' , ( ) => {
723
723
const onKeyDown = jest . fn ( ) ;
724
724
const onChange = jest . fn ( ) ;
725
+ const textareaRef = jest . fn ( ) ;
725
726
const wrapper = mount (
726
727
< Select
727
728
mode = "combobox"
728
- getInputElement = { ( ) => < textarea onKeyDown = { onKeyDown } onChange = { onChange } /> }
729
+ getInputElement = { ( ) => (
730
+ < textarea onKeyDown = { onKeyDown } onChange = { onChange } ref = { textareaRef } />
731
+ ) }
729
732
>
730
733
< Option value = "1" > 1</ Option >
731
734
< Option value = "2" > 2</ Option >
@@ -744,6 +747,7 @@ describe('Select.Basic', () => {
744
747
expect ( wrapper . find ( 'textarea' ) . props ( ) . value ) . toEqual ( '1' ) ;
745
748
expect ( onKeyDown ) . toHaveBeenCalled ( ) ;
746
749
expect ( onChange ) . toHaveBeenCalled ( ) ;
750
+ expect ( textareaRef ) . toHaveBeenCalled ( ) ;
747
751
} ) ;
748
752
749
753
describe ( 'propTypes' , ( ) => {
You can’t perform that action at this time.
0 commit comments