@@ -9,10 +9,10 @@ describe("MDP Initialization", function () {
9
9
document . body . innerHTML = '<input id="datepicker" />' ;
10
10
$input = $ ( "#datepicker" ) ;
11
11
12
- spyDatepickerUpdate = jest . spyOn ( $ . datepicker , ' _updateDatepicker' ) ;
12
+ spyDatepickerUpdate = jest . spyOn ( $ . datepicker , " _updateDatepicker" ) ;
13
13
14
14
// fix the offsetWidth to make the datepicker visible in jsdom
15
- jest . spyOn ( $input [ 0 ] , ' offsetWidth' , ' get' ) . mockReturnValue ( 1 ) ;
15
+ jest . spyOn ( $input [ 0 ] , " offsetWidth" , " get" ) . mockReturnValue ( 1 ) ;
16
16
} ) ;
17
17
18
18
afterEach ( function ( ) {
@@ -26,27 +26,27 @@ describe("MDP Initialization", function () {
26
26
27
27
it ( "should call a beforeShow event with default behavior" , function ( ) {
28
28
$input . multiDatesPicker ( ) ;
29
-
29
+
30
30
// triggers the beforeShow event
31
- $input . trigger ( ' focus' ) ;
31
+ $input . trigger ( " focus" ) ;
32
32
33
33
expect ( spyDatepickerUpdate ) . toHaveBeenCalledTimes ( normalDatepickerUpdates ) ;
34
34
} ) ;
35
35
36
36
it ( "should call a custom beforeShow event that interrupts the default behavior" , function ( ) {
37
- const beforeShow = jest . fn ( _ => false ) ; // returning false to interrupt the default behavior
37
+ const beforeShow = jest . fn ( ( _ ) => false ) ; // returning false to interrupt the default behavior
38
38
$input . multiDatesPicker ( { beforeShow } ) ;
39
39
40
40
// triggers the beforeShow event with a custom function
41
- $input . trigger ( ' focus' ) ;
41
+ $input . trigger ( " focus" ) ;
42
42
43
43
expect ( beforeShow ) . toHaveBeenCalled ( ) ;
44
- expect ( spyDatepickerUpdate ) . toHaveBeenCalledTimes ( normalDatepickerUpdates - 1 ) ;
44
+ expect ( spyDatepickerUpdate ) . toHaveBeenCalledTimes (
45
+ normalDatepickerUpdates - 1 ,
46
+ ) ;
45
47
} ) ;
46
48
} ) ;
47
49
48
-
49
-
50
50
describe ( "setMode" , function ( ) {
51
51
let $input , date ;
52
52
@@ -190,7 +190,7 @@ describe("init", function () {
190
190
191
191
it ( "should correctly set disabled dates and update calendar range" , function ( ) {
192
192
const $input = $ ( '<input type="text" id="test-datepicker">' ) . appendTo (
193
- "body"
193
+ "body" ,
194
194
) ;
195
195
196
196
// Initialize with options that set minDate and maxDate
@@ -239,7 +239,9 @@ describe("invalid methods", function () {
239
239
it ( "should error on non-existing method" , function ( ) {
240
240
expect ( function ( ) {
241
241
$input . multiDatesPicker ( "happyNewYear" ) ;
242
- } ) . toThrowError ( "Method happyNewYear does not exist on jQuery.multiDatesPicker" ) ;
242
+ } ) . toThrowError (
243
+ "Method happyNewYear does not exist on jQuery.multiDatesPicker" ,
244
+ ) ;
243
245
} ) ;
244
246
} ) ;
245
247
@@ -562,7 +564,7 @@ describe("gotDate", function () {
562
564
$input . multiDatesPicker (
563
565
"addDates" ,
564
566
[ "10/11/2024" , "10/13/2024" ] ,
565
- "disabled"
567
+ "disabled" ,
566
568
) ;
567
569
} ) ;
568
570
@@ -668,7 +670,7 @@ describe("getDates", function () {
668
670
$input . multiDatesPicker (
669
671
"addDates" ,
670
672
[ "10/11/2024" , "10/13/2024" ] ,
671
- "disabled"
673
+ "disabled" ,
672
674
) ;
673
675
} ) ;
674
676
@@ -681,7 +683,7 @@ describe("getDates", function () {
681
683
const disabledDates = $input . multiDatesPicker (
682
684
"getDates" ,
683
685
"string" ,
684
- "disabled"
686
+ "disabled" ,
685
687
) ;
686
688
expect ( disabledDates ) . toEqual ( [ "10/11/2024" , "10/13/2024" ] ) ;
687
689
} ) ;
@@ -699,7 +701,7 @@ describe("getDates", function () {
699
701
const disabledDates = $input . multiDatesPicker (
700
702
"getDates" ,
701
703
"object" ,
702
- "disabled"
704
+ "disabled" ,
703
705
) ;
704
706
expect ( disabledDates ) . toEqual ( [
705
707
new Date ( "10/11/2024" ) ,
@@ -720,7 +722,7 @@ describe("getDates", function () {
720
722
const disabledDates = $input . multiDatesPicker (
721
723
"getDates" ,
722
724
"number" ,
723
- "disabled"
725
+ "disabled" ,
724
726
) ;
725
727
expect ( disabledDates ) . toEqual ( [
726
728
Date . parse ( "10/11/2024" ) ,
0 commit comments