11jest . dontMock ( "jquery" ) . dontMock ( "../jquery.timepicker" ) ;
22
3- import jQuery from 'jquery' ;
3+ import $ from 'jquery' ;
44require ( '../jquery.timepicker' ) ;
55
66const TEST_INPUT = "testInput" ;
@@ -9,26 +9,26 @@ beforeEach(() => {
99 document . body . innerHTML = `<div>
1010 <input type="text" id="${ TEST_INPUT } " />
1111 </div>` ;
12- jQuery ( `#${ TEST_INPUT } ` ) . get ( 0 ) . dataset = { }
12+ $ ( `#${ TEST_INPUT } ` ) . get ( 0 ) . dataset = { }
1313} ) ;
1414
1515test ( "timepicker initializes" , ( ) => {
16- jQuery ( `#${ TEST_INPUT } ` ) . timepicker ( ) ;
16+ $ ( `#${ TEST_INPUT } ` ) . timepicker ( ) ;
1717} ) ;
1818
1919test ( "show single string noneOption correctly" , ( ) => {
20- jQuery ( `#${ TEST_INPUT } ` ) . timepicker ( {
20+ $ ( `#${ TEST_INPUT } ` ) . timepicker ( {
2121 "noneOption" : "----"
2222 } ) . timepicker ( 'show' ) ;
2323
24- jQuery ( '.ui-timepicker-list li:first-child' ) . trigger ( 'click' ) ;
25- expect ( jQuery ( `#${ TEST_INPUT } ` ) . val ( ) ) . toEqual ( '' ) ;
24+ $ ( '.ui-timepicker-list li:first-child' ) . trigger ( 'click' ) ;
25+ expect ( $ ( `#${ TEST_INPUT } ` ) . val ( ) ) . toEqual ( '' ) ;
2626} ) ;
2727
2828test ( "timepicker can parse time value" , ( ) => {
29- jQuery ( `#${ TEST_INPUT } ` ) . val ( '2:37pm' ) ;
30- jQuery ( `#${ TEST_INPUT } ` ) . timepicker ( ) ;
29+ $ ( `#${ TEST_INPUT } ` ) . val ( '2:37pm' ) ;
30+ $ ( `#${ TEST_INPUT } ` ) . timepicker ( ) ;
3131
3232 const expectedSecondsFromMidnight = 14 * 3600 + 37 * 60 ;
33- expect ( jQuery ( `#${ TEST_INPUT } ` ) . timepicker ( 'getSecondsFromMidnight' ) ) . toEqual ( expectedSecondsFromMidnight ) ;
33+ expect ( $ ( `#${ TEST_INPUT } ` ) . timepicker ( 'getSecondsFromMidnight' ) ) . toEqual ( expectedSecondsFromMidnight ) ;
3434} ) ;
0 commit comments