🆙 Upgrade rc-input-number@4.4.0 to fix 13896

This commit is contained in:
afc163 2019-02-20 18:18:19 +08:00 committed by 偏右
parent 8389b94cf5
commit 7bbeaff3ed
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,18 @@
import React from 'react';
import { mount } from 'enzyme';
import InputNumber from '..';
import focusTest from '../../../tests/shared/focusTest';
describe('InputNumber', () => {
focusTest(InputNumber);
// https://github.com/ant-design/ant-design/issues/13896
it('should return null when blur a empty input number', () => {
const onChange = jest.fn();
const wrapper = mount(<InputNumber defaultValue="1" onChange={onChange} />);
wrapper.find('input').simulate('change', { target: { value: '' } });
expect(onChange).toHaveBeenLastCalledWith('');
wrapper.find('input').simulate('blur');
expect(onChange).toHaveBeenLastCalledWith(null);
});
});

View File

@ -65,7 +65,7 @@
"rc-dropdown": "~2.4.1",
"rc-editor-mention": "^1.1.7",
"rc-form": "^2.4.0",
"rc-input-number": "~4.3.7",
"rc-input-number": "~4.4.0",
"rc-menu": "~7.4.12",
"rc-notification": "~3.3.0",
"rc-pagination": "~1.17.7",