@@ -6,7 +6,12 @@ import { getInitialMonth } from "./getInitialMonth";
66
77it ( "return start of month" , ( ) => {
88 const month = new Date ( 2010 , 11 , 12 ) ;
9- const initialMonth = getInitialMonth ( { month } , defaultDateLib ) ;
9+ const initialMonth = getInitialMonth (
10+ { month } ,
11+ undefined ,
12+ undefined ,
13+ defaultDateLib
14+ ) ;
1015 expect ( isSameDay ( initialMonth , startOfMonth ( month ) ) ) . toBe ( true ) ;
1116} ) ;
1217
@@ -18,6 +23,8 @@ describe("when no startMonth or endMonth is given", () => {
1823 it ( "return that month" , ( ) => {
1924 const initialMonth = getInitialMonth (
2025 { month, defaultMonth, today } ,
26+ undefined ,
27+ undefined ,
2128 defaultDateLib
2229 ) ;
2330 expect ( isSameMonth ( initialMonth , month ) ) . toBe ( true ) ;
@@ -27,14 +34,21 @@ describe("when no startMonth or endMonth is given", () => {
2734 it ( "return that month" , ( ) => {
2835 const initialMonth = getInitialMonth (
2936 { defaultMonth, today } ,
37+ undefined ,
38+ undefined ,
3039 defaultDateLib
3140 ) ;
3241 expect ( isSameMonth ( initialMonth , defaultMonth ) ) . toBe ( true ) ;
3342 } ) ;
3443 } ) ;
3544 describe ( "when no month or defaultMonth" , ( ) => {
3645 it ( "return the today month" , ( ) => {
37- const initialMonth = getInitialMonth ( { today } , defaultDateLib ) ;
46+ const initialMonth = getInitialMonth (
47+ { today } ,
48+ undefined ,
49+ undefined ,
50+ defaultDateLib
51+ ) ;
3852 expect ( isSameMonth ( initialMonth , today ) ) . toBe ( true ) ;
3953 } ) ;
4054 } ) ;
@@ -45,7 +59,9 @@ describe("when startMonth is given and is after the default initial month", () =
4559 const month = new Date ( 2010 , 11 , 12 ) ;
4660 const startMonth = addMonths ( month , 1 ) ;
4761 const initialMonth = getInitialMonth (
48- { month, numberOfMonths : 3 , startMonth } ,
62+ { month, numberOfMonths : 3 } ,
63+ startMonth ,
64+ undefined ,
4965 defaultDateLib
5066 ) ;
5167 expect ( isSameMonth ( initialMonth , startMonth ) ) . toBe ( true ) ;
@@ -59,7 +75,9 @@ describe("when endMonth is given", () => {
5975 describe ( "when the number of month is 1" , ( ) => {
6076 it ( "return the endMonth" , ( ) => {
6177 const initialMonth = getInitialMonth (
62- { month, endMonth } ,
78+ { month } ,
79+ undefined ,
80+ endMonth ,
6381 defaultDateLib
6482 ) ;
6583 expect ( isSameMonth ( initialMonth , endMonth ) ) . toBe ( true ) ;
@@ -68,7 +86,9 @@ describe("when endMonth is given", () => {
6886 describe ( "when the number of month is 3" , ( ) => {
6987 it ( "return the endMonth plus the number of months" , ( ) => {
7088 const initialMonth = getInitialMonth (
71- { month, numberOfMonths : 3 , endMonth } ,
89+ { month, numberOfMonths : 3 } ,
90+ undefined ,
91+ endMonth ,
7292 defaultDateLib
7393 ) ;
7494 const expectedMonth = addMonths ( endMonth , - 1 * ( 3 - 1 ) ) ;
0 commit comments