@@ -19,10 +19,10 @@ describe('InputNumber.Github', () => {
1919    const  wrapper  =  mount ( < InputNumber  step = { 0.1 }  /> ) ; 
2020    wrapper . focusInput ( ) ; 
2121    wrapper . changeValue ( '2' ) ; 
22-     expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( '2' ) ; 
22+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '2' ) ; 
2323
2424    wrapper . blurInput ( ) ; 
25-     expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( '2.0' ) ; 
25+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '2.0' ) ; 
2626  } ) ; 
2727
2828  // https://github.com/react-component/input-number/issues/197 
@@ -66,7 +66,7 @@ describe('InputNumber.Github', () => {
6666    wrapper . changeValue ( 'foo' ) ; 
6767
6868    wrapper . find ( '.rc-input-number-handler-up' ) . simulate ( 'mouseDown' ) ; 
69-     expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( '2' ) ; 
69+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '2' ) ; 
7070  } ) ; 
7171
7272  // https://github.com/react-component/input-number/issues/35 
@@ -89,7 +89,7 @@ describe('InputNumber.Github', () => {
8989      // no number like 1.5499999999999999 
9090      expect ( ( num . toString ( ) . split ( '.' ) [ 1 ]  ||  '' ) . length  <  3 ) . toBeTruthy ( ) ; 
9191      const  expectedValue  =  Number ( ( ( 200  -  i )  /  100 ) . toFixed ( 2 ) ) ; 
92-       expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( String ( expectedValue . toFixed ( 2 ) ) ) ; 
92+       expect ( wrapper . getInputValue ( ) ) . toEqual ( String ( expectedValue . toFixed ( 2 ) ) ) ; 
9393      expect ( num ) . toEqual ( expectedValue ) ; 
9494    } 
9595
@@ -99,7 +99,7 @@ describe('InputNumber.Github', () => {
9999      // no number like 1.5499999999999999 
100100      expect ( ( num . toString ( ) . split ( '.' ) [ 1 ]  ||  '' ) . length  <  3 ) . toBeTruthy ( ) ; 
101101      const  expectedValue  =  Number ( ( ( i  -  200 )  /  100 ) . toFixed ( 2 ) ) ; 
102-       expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( String ( expectedValue . toFixed ( 2 ) ) ) ; 
102+       expect ( wrapper . getInputValue ( ) ) . toEqual ( String ( expectedValue . toFixed ( 2 ) ) ) ; 
103103      expect ( num ) . toEqual ( expectedValue ) ; 
104104    } 
105105  } ) ; 
@@ -141,10 +141,10 @@ describe('InputNumber.Github', () => {
141141
142142    wrapper . focusInput ( ) ; 
143143    wrapper . changeValue ( '1.' ) ; 
144-     expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( '1.' ) ; 
144+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '1.' ) ; 
145145
146146    wrapper . blurInput ( ) ; 
147-     expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( '1' ) ; 
147+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '1' ) ; 
148148  } ) ; 
149149
150150  // https://github.com/ant-design/ant-design/issues/5012 
@@ -170,20 +170,20 @@ describe('InputNumber.Github', () => {
170170
171171    wrapper . focusInput ( ) ; 
172172    wrapper . changeValue ( '6.0' ) ; 
173-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '6.0' ) ; 
173+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '6.0' ) ; 
174174    expect ( num ) . toEqual ( 6 ) ; 
175175
176176    wrapper . blurInput ( ) ; 
177-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '6' ) ; 
177+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '6' ) ; 
178178    expect ( num ) . toEqual ( 6 ) ; 
179179
180180    wrapper . focusInput ( ) ; 
181181    wrapper . changeValue ( '6.10' ) ; 
182-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '6.10' ) ; 
182+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '6.10' ) ; 
183183    expect ( num ) . toEqual ( 6.1 ) ; 
184184
185185    wrapper . blurInput ( ) ; 
186-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '6.1' ) ; 
186+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '6.1' ) ; 
187187    expect ( num ) . toEqual ( 6.1 ) ; 
188188  } ) ; 
189189
@@ -225,9 +225,9 @@ describe('InputNumber.Github', () => {
225225    const  wrapper  =  mount ( < InputNumber  /> ) ; 
226226    wrapper . focusInput ( ) ; 
227227    wrapper . changeValue ( '111111111111111111111' ) ; 
228-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '111111111111111111111' ) ; 
228+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '111111111111111111111' ) ; 
229229    wrapper . changeValue ( '11111111111111111111111111111' ) ; 
230-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '11111111111111111111111111111' ) ; 
230+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '11111111111111111111111111111' ) ; 
231231  } ) ; 
232232
233233  // https://github.com/ant-design/ant-design/issues/7363 
@@ -279,10 +279,10 @@ describe('InputNumber.Github', () => {
279279    wrapper . focusInput ( ) ; 
280280    wrapper . blurInput ( ) ; 
281281
282-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '2.0' ) ; 
282+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '2.0' ) ; 
283283
284284    wrapper . focusInput ( ) ; 
285-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '2.0' ) ; 
285+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '2.0' ) ; 
286286  } ) ; 
287287
288288  // https://github.com/ant-design/ant-design/issues/7940 
@@ -304,15 +304,15 @@ describe('InputNumber.Github', () => {
304304
305305    wrapper . focusInput ( ) ; 
306306    wrapper . changeValue ( '1' ) ; 
307-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '1' ) ; 
307+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '1' ) ; 
308308  } ) ; 
309309
310310  // https://github.com/ant-design/ant-design/issues/8196 
311311  it ( 'Allow input 。' ,  ( )  =>  { 
312312    const  onChange  =  jest . fn ( ) ; 
313313    const  wrapper  =  mount ( < InputNumber  min = { 1 }  max = { 10 }  onChange = { onChange }  /> ) ; 
314314    wrapper . changeValue ( '8。1' ) ; 
315-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '8.1' ) ; 
315+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '8.1' ) ; 
316316    expect ( onChange ) . toHaveBeenCalledWith ( 8.1 ) ; 
317317  } ) ; 
318318
@@ -350,7 +350,7 @@ describe('InputNumber.Github', () => {
350350    ) ; 
351351
352352    wrapper . blurInput ( ) ; 
353-     expect ( wrapper . find ( 'input' ) . props ( ) . value ) . toEqual ( '100%' ) ; 
353+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '100%' ) ; 
354354    expect ( valueOnBlur ) . toEqual ( '100%' ) ; 
355355  } ) ; 
356356
@@ -364,15 +364,15 @@ describe('InputNumber.Github', () => {
364364
365365    wrapper . setProps ( {  min : 11  } ) ; 
366366    wrapper . update ( ) ; 
367-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '10' ) ; 
367+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '10' ) ; 
368368    expect ( wrapper . exists ( '.rc-input-number-out-of-range' ) ) . toBeTruthy ( ) ; 
369369    expect ( onChange ) . toHaveBeenCalledTimes ( 0 ) ; 
370370
371371    wrapper . setProps ( {  value : 15  } ) ; 
372372    wrapper . setProps ( {  max : 14  } ) ; 
373373    wrapper . update ( ) ; 
374374
375-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '15' ) ; 
375+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '15' ) ; 
376376    expect ( wrapper . exists ( '.rc-input-number-out-of-range' ) ) . toBeTruthy ( ) ; 
377377    expect ( onChange ) . toHaveBeenCalledTimes ( 0 ) ; 
378378  } ) ; 
@@ -397,7 +397,7 @@ describe('InputNumber.Github', () => {
397397    wrapper . changeValue ( '401' ) ; 
398398
399399    // Demo re-render and the `value` prop is still 40, but the user input should be retained 
400-     expect ( wrapper . findInput ( ) . props ( ) . value ) . toEqual ( '401' ) ; 
400+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '401' ) ; 
401401  } ) ; 
402402
403403  // https://github.com/ant-design/ant-design/issues/16710 
@@ -427,6 +427,6 @@ describe('InputNumber.Github', () => {
427427      . first ( ) 
428428      . simulate ( 'change' ,  {  target : {  value : '0'  }  } ) ; 
429429
430-     expect ( wrapper . find ( 'input' ) . last ( ) . props ( ) . value ) . toEqual ( '1' ) ; 
430+     expect ( wrapper . getInputValue ( ) ) . toEqual ( '1' ) ; 
431431  } ) ; 
432432} ) ; 
0 commit comments