Browse Source

test: Fix focus test

pull/23852/head
zombiej 5 years ago
parent
commit
29b98ea63a
  1. 8
      components/auto-complete/__tests__/focus.test.js

8
components/auto-complete/__tests__/focus.test.js

@ -35,6 +35,7 @@ describe('AutoComplete children could be focus', () => {
.focus();
jest.runAllTimers();
expect(handleFocus).toHaveBeenCalled();
wrapper.unmount();
});
it('blur() and onBlur', () => {
@ -51,6 +52,7 @@ describe('AutoComplete children could be focus', () => {
.blur();
jest.runAllTimers();
expect(handleBlur).toHaveBeenCalled();
wrapper.unmount();
});
it('child.ref should work', () => {
@ -67,7 +69,11 @@ describe('AutoComplete children could be focus', () => {
let inputRef;
mount(
<AutoComplete dataSource={[]}>
<input ref={node => { inputRef = node; }} />
<input
ref={node => {
inputRef = node;
}}
/>
</AutoComplete>,
);
expect(typeof inputRef.focus).toBe('function');

Loading…
Cancel
Save