@@ -567,7 +567,7 @@ describe('DateInput', () => {
567567 expect ( document . activeElement ) . toBe ( dayInput . getDOMNode ( ) ) ;
568568 } ) ;
569569
570- it ( 'jumps to the next field when a value which can\'t be extended to another valid value is entered ' , ( ) => {
570+ it ( 'jumps to the next field when a value which can\'t be extended to another valid value is entered' , ( ) => {
571571 const component = mount (
572572 < DateInput { ...defaultProps } />
573573 ) ;
@@ -584,7 +584,24 @@ describe('DateInput', () => {
584584 expect ( document . activeElement ) . toBe ( monthInput . getDOMNode ( ) ) ;
585585 } ) ;
586586
587- it ( 'does not jump the next field when a value which can be extended to another valid value is entered ' , ( ) => {
587+ it ( 'jumps to the next field when a value as long as the length of maximum value is entered' , ( ) => {
588+ const component = mount (
589+ < DateInput { ...defaultProps } />
590+ ) ;
591+
592+ const customInputs = component . find ( 'input[type="number"]' ) ;
593+ const dayInput = customInputs . at ( 0 ) ;
594+ const monthInput = customInputs . at ( 1 ) ;
595+
596+ dayInput . getDOMNode ( ) . focus ( ) ;
597+ dayInput . getDOMNode ( ) . value = '03' ;
598+
599+ dayInput . simulate ( 'keyup' , { target : dayInput . getDOMNode ( ) , key : '3' } ) ;
600+
601+ expect ( document . activeElement ) . toBe ( monthInput . getDOMNode ( ) ) ;
602+ } ) ;
603+
604+ it ( 'does not jump the next field when a value which can be extended to another valid value is entered' , ( ) => {
588605 const component = mount (
589606 < DateInput { ...defaultProps } />
590607 ) ;
0 commit comments