import React from 'react'; import { mount } from 'enzyme'; import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; import { InputRef } from '../Input'; import Input from '..'; import { render, fireEvent } from '../../../tests/utils'; const { TextArea } = Input; describe('Input.Focus', () => { let inputSpy: ReturnType; let textareaSpy: ReturnType; let focus: ReturnType; let setSelectionRange: ReturnType; beforeEach(() => { focus = jest.fn(); setSelectionRange = jest.fn(); inputSpy = spyElementPrototypes(HTMLInputElement, { focus, setSelectionRange, }); textareaSpy = spyElementPrototypes(HTMLTextAreaElement, { focus, setSelectionRange, }); }); afterEach(() => { inputSpy.mockRestore(); textareaSpy.mockRestore(); }); it('start', () => { const ref = React.createRef(); mount(