Skip to content

Commit

Permalink
test(NumberPicker): numberPicker add test (alibaba-fusion#3477)
Browse files Browse the repository at this point in the history
  • Loading branch information
weinianyang authored Nov 4, 2021
1 parent 74c664a commit 9cbbc8d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/number-picker/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ describe('number-picker', () => {
assert(wrapper.find('input').prop('value') === 5);

});
it('if max or min were undefined or null should infinity', () => {
const wrapper = mount(<NumberPicker max={10} value={10} min={8}/>);
wrapper.find('button').at(0).simulate('click');
assert(wrapper.find('input').props('value').value === 10);
wrapper.setProps({ max: undefined });
wrapper.find('button').at(0).simulate('click');
assert(wrapper.find('input').props('value').value === 11);
wrapper.setProps({ value: 8 });
wrapper.find('button').at(1).simulate('click');
assert(wrapper.find('input').props('value').value === 8);
wrapper.setProps({ min: undefined });
wrapper.find('button').at(1).simulate('click');
assert(wrapper.find('input').props('value').value === 7);
})
});

describe('stringMode', () => {
Expand Down

0 comments on commit 9cbbc8d

Please sign in to comment.