import React from 'react'; import { mount } from 'enzyme'; // eslint-disable-next-line import/no-unresolved import Input from '..'; import focusTest from '../../../tests/shared/focusTest'; import calculateNodeHeight, { calculateNodeStyling } from '../calculateNodeHeight'; 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(