Skip to content

Commit 1d35b68

Browse files
committed
update test case
1 parent 5897bfe commit 1d35b68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/Select.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,13 @@ describe('Select.Basic', () => {
722722
it('combobox could customize input element', () => {
723723
const onKeyDown = jest.fn();
724724
const onChange = jest.fn();
725+
const textareaRef = jest.fn();
725726
const wrapper = mount(
726727
<Select
727728
mode="combobox"
728-
getInputElement={() => <textarea onKeyDown={onKeyDown} onChange={onChange} />}
729+
getInputElement={() => (
730+
<textarea onKeyDown={onKeyDown} onChange={onChange} ref={textareaRef} />
731+
)}
729732
>
730733
<Option value="1">1</Option>
731734
<Option value="2">2</Option>
@@ -744,6 +747,7 @@ describe('Select.Basic', () => {
744747
expect(wrapper.find('textarea').props().value).toEqual('1');
745748
expect(onKeyDown).toHaveBeenCalled();
746749
expect(onChange).toHaveBeenCalled();
750+
expect(textareaRef).toHaveBeenCalled();
747751
});
748752

749753
describe('propTypes', () => {

0 commit comments

Comments
 (0)