import React from 'react'; import { mount } from 'enzyme'; import RcTextArea from 'rc-textarea'; import Input from '..'; import focusTest from '../../../tests/shared/focusTest'; import { sleep } from '../../../tests/utils'; const { TextArea } = Input; focusTest(TextArea); describe('TextArea', () => { const originalGetComputedStyle = window.getComputedStyle; beforeAll(() => { Object.defineProperty(window, 'getComputedStyle', { value: node => ({ getPropertyValue: prop => { if (prop === 'box-sizing') { return originalGetComputedStyle(node)[prop] || 'border-box'; } return originalGetComputedStyle(node)[prop]; }, }), }); }); afterAll(() => { Object.defineProperty(window, 'getComputedStyle', { value: originalGetComputedStyle, }); }); it('should auto calculate height according to content length', async () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount(