@@ -919,29 +919,35 @@ describe('Datetime', () => {
919
919
it ( 'displayTimeZone -> value should change format (undefined->America/New_York)' , ( ) => {
920
920
const date = new Date ( 2000 , 0 , 15 , 2 , 2 , 2 , 2 ) ,
921
921
momentDate = moment ( date ) ,
922
- component = utils . createDatetime ( { value : momentDate } ) ,
922
+ component = utils . createDatetime ( { initialViewMode : 'time' , timeFormat : 'HH' , value : momentDate } ) ,
923
923
displayTimeZone = ( moment . tz . guess ( ) === 'America/New_York' ? 'America/Los_Angeles' : 'America/New_York' ) ;
924
924
925
925
const valueBefore = utils . getInputValue ( component ) ;
926
+ const timeCountBefore = component . find ( '.rdtCount' ) . text ( ) ;
926
927
component . setProps ( { displayTimeZone : displayTimeZone } , ( ) => {
927
928
const valueAfter = utils . getInputValue ( component ) ;
928
929
929
930
expect ( valueBefore ) . not . toEqual ( valueAfter ) ;
930
931
} ) ;
932
+ const timeCountAfter = component . find ( '.rdtCount' ) . text ( ) ;
933
+ expect ( timeCountBefore ) . not . toEqual ( timeCountAfter ) ;
931
934
} ) ;
932
935
933
936
it ( 'displayTimeZone -> value should change format (America/New_York->undefined)' , ( ) => {
934
937
const date = new Date ( 2000 , 0 , 15 , 2 , 2 , 2 , 2 ) ,
935
938
momentDate = moment ( date ) ,
936
939
displayTimeZone = ( moment . tz . guess ( ) === 'America/New_York' ? 'America/Los_Angeles' : 'America/New_York' ) ,
937
- component = utils . createDatetime ( { value : momentDate , displayTimeZone : displayTimeZone } ) ;
940
+ component = utils . createDatetime ( { initialViewMode : 'time' , timeFormat : 'HH' , value : momentDate , displayTimeZone : displayTimeZone } ) ;
938
941
939
942
const valueBefore = utils . getInputValue ( component ) ;
943
+ const timeCountBefore = component . find ( '.rdtCount' ) . text ( ) ;
940
944
component . setProps ( { displayTimeZone : undefined } , ( ) => {
941
945
const valueAfter = utils . getInputValue ( component ) ;
942
946
943
947
expect ( valueBefore ) . not . toEqual ( valueAfter ) ;
944
948
} ) ;
949
+ const timeCountAfter = component . find ( '.rdtCount' ) . text ( ) ;
950
+ expect ( timeCountBefore ) . not . toEqual ( timeCountAfter ) ;
945
951
} ) ;
946
952
947
953
it ( 'locale -> picker should change language (initialViewMode=days)' , ( ) => {
0 commit comments