@@ -239,13 +239,13 @@ describe('InputNumber.Github', () => {
239239
240240 wrapper . focusInput ( ) ;
241241 wrapper . changeValue ( '123' ) ;
242- expect ( onChange ) . toHaveBeenCalledTimes ( 1 ) ;
243- expect ( onChange ) . toHaveBeenCalledWith ( 10 ) ;
242+ expect ( onChange ) . toHaveBeenCalledTimes ( 0 ) ;
244243 expect ( onInput ) . toHaveBeenCalledTimes ( 1 ) ;
245244 expect ( onInput ) . toHaveBeenCalledWith ( '123' ) ;
246245
247246 wrapper . blurInput ( ) ;
248247 expect ( onChange ) . toHaveBeenCalledTimes ( 1 ) ;
248+ expect ( onChange ) . toHaveBeenCalledWith ( 10 ) ;
249249 expect ( onInput ) . toHaveBeenCalledTimes ( 1 ) ;
250250
251251 // repeat it, it should works in same way
@@ -260,6 +260,33 @@ describe('InputNumber.Github', () => {
260260 expect ( onInput ) . toHaveBeenCalledTimes ( 2 ) ;
261261 } ) ;
262262
263+ // https://github.com/ant-design/ant-design/issues/30465
264+ it ( 'not block user input with min & max' , ( ) => {
265+ const onChange = jest . fn ( ) ;
266+ const wrapper = mount ( < InputNumber min = { 1900 } onChange = { onChange } /> ) ;
267+
268+ wrapper . focusInput ( ) ;
269+
270+ wrapper . changeValue ( '2' ) ;
271+ expect ( onChange ) . not . toHaveBeenCalled ( ) ;
272+
273+ wrapper . changeValue ( '20' ) ;
274+ expect ( onChange ) . not . toHaveBeenCalled ( ) ;
275+
276+ wrapper . changeValue ( '200' ) ;
277+ expect ( onChange ) . not . toHaveBeenCalled ( ) ;
278+
279+ wrapper . changeValue ( '2000' ) ;
280+ expect ( onChange ) . toHaveBeenCalledWith ( 2000 ) ;
281+ onChange . mockRestore ( ) ;
282+
283+ wrapper . changeValue ( '1' ) ;
284+ expect ( onChange ) . not . toHaveBeenCalled ( ) ;
285+
286+ wrapper . blurInput ( ) ;
287+ expect ( onChange ) . toHaveBeenCalledWith ( 1900 ) ;
288+ } ) ;
289+
263290 // https://github.com/ant-design/ant-design/issues/7867
264291 it ( 'focus should not cut precision of input value' , ( ) => {
265292 const Demo = ( ) => {
0 commit comments