* currently user cannot enter "0 ", but this prevents user from entering a space after any digit, i.e. "3 4" or "3 " or "3 3 3 "
This commit is contained in:
parent
3626705ada
commit
759070488a
@ -87,10 +87,16 @@ describe('InputNumber', () => {
|
||||
it('throws an error if input value for comparison is not a string', () => {
|
||||
const invalidInputValueType = 340282366920938463463374607431768211456;
|
||||
|
||||
expect(() => { wrapper.instance().isValidNumber(invalidInputValueType, '0', DEFAULT_BITLENGTH); }).toThrow();
|
||||
expect(() => { wrapper.instance().isValidNumber(invalidInputValueType, DEFAULT_BITLENGTH); }).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
it('should not be valid when input contains spaces', () => {
|
||||
const invalidInputValueType = '3 4';
|
||||
|
||||
expect(wrapper.instance().isValidNumber(invalidInputValueType, DEFAULT_BITLENGTH)).toBe(false);
|
||||
});
|
||||
|
||||
it('should not be valid when user enters positive value greater than or equal to the 128 bit max for latest chain', () => {
|
||||
expect(wrapper.instance().isValidNumber(max128BN.toString(10), DEFAULT_BITLENGTH)).toBe(false);
|
||||
});
|
||||
|
||||
@ -126,9 +126,6 @@ class InputNumber extends React.PureComponent<Props, State> {
|
||||
}));
|
||||
}
|
||||
|
||||
// remove spaces even though not possible as user restricted from entering spacebar key in onKeyDown
|
||||
input = input.toLowerCase().split(' ').join('');
|
||||
|
||||
if (this.isNonInteger(input)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user