Skip to content

Commit 1cc328d

Browse files
author
刘诗焕
committed
fix: onChange after onKeyDown test
1 parent bff4cfc commit 1cc328d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tests/github.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,12 @@ describe('InputNumber.Github', () => {
458458
wrapper
459459
.find('input')
460460
.last()
461+
.simulate('keyDown')
461462
.simulate('change', { target: { value: '1.23' } });
462463
wrapper
463464
.find('input')
464465
.first()
466+
.simulate('keyDown')
465467
.simulate('change', { target: { value: '0' } });
466468

467469
expect(wrapper.find('input').last().props().value).toEqual('1');

tests/keyboard.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ describe('InputNumber.Keyboard', () => {
3535
const onChange = jest.fn();
3636
const wrapper = mount(<InputNumber precision={0} onChange={onChange} />);
3737

38-
wrapper.find('input').simulate('change', { target: { value: '2.3333' } });
38+
wrapper
39+
.find('input')
40+
.simulate('keyDown')
41+
.simulate('change', { target: { value: '2.3333' } });
3942
expect(onChange).toHaveBeenCalledWith(2.3333);
4043
onChange.mockReset();
4144

0 commit comments

Comments
 (0)