diff --git a/components/grid/__tests__/index.test.js b/components/grid/__tests__/index.test.js index d529ef053b..fdc8d58d54 100644 --- a/components/grid/__tests__/index.test.js +++ b/components/grid/__tests__/index.test.js @@ -62,4 +62,16 @@ describe('Grid', () => { ); expect(wrapper).toMatchSnapshot(); }); + + it('when component has been unmounted, componentWillUnmount should be called', () => { + const wrapper = mount(); + const willUnmount = jest.spyOn(wrapper.instance(), 'componentWillUnmount'); + wrapper.unmount(); + expect(willUnmount).toHaveBeenCalled(); + }); + + it('when typeof getGutter is object', () => { + const wrapper = mount().instance(); + expect(wrapper.getGutter()).toBe(8); + }); }); diff --git a/components/input/__tests__/index.test.js b/components/input/__tests__/index.test.js index 24bc106c0b..d60ba2a9f4 100644 --- a/components/input/__tests__/index.test.js +++ b/components/input/__tests__/index.test.js @@ -1,10 +1,10 @@ import React from 'react'; - import { mount } from 'enzyme'; - +/* eslint-disable import/no-unresolved */ import Form from '../../form'; import Input from '..'; import focusTest from '../../../tests/shared/focusTest'; +import calculateNodeHeight, { calculateNodeStyling } from '../calculateNodeHeight'; const { TextArea } = Input; @@ -70,6 +70,70 @@ describe('TextArea', () => { const wrapper = mount(