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'; 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]; }, }), }); jest.useFakeTimers(); }); afterAll(() => { Object.defineProperty(window, 'getComputedStyle', { value: originalGetComputedStyle, }); jest.useRealTimers(); }); it('should auto calculate height according to content length', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); const wrapper = mount(