We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 167d072 commit 12e4e92Copy full SHA for 12e4e92
src/components/input/__tests__/Input.test.js
@@ -259,5 +259,18 @@ describe('Input', () => {
259
rerender(<Input type="number" value={12} />);
260
expect(input).toHaveValue(12);
261
});
262
+
263
+ test('returns NaN once for invalid number', () => {
264
+ const {
265
+ container: {firstChild: input}
266
+ } = render(
267
+ <Input type="number" min={0} value={0} setProps={mockSetProps} />
268
+ );
269
270
+ userEvent.type(input, '{backspace}-100');
271
272
+ expect(mockSetProps.mock.calls).toHaveLength(1);
273
+ expect(mockSetProps.mock.calls[0][0]).toEqual({value: NaN});
274
+ });
275
276
0 commit comments