@@ -175,8 +175,48 @@ describe('useCalendar', () => {
175
175
${ 'going forward two' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'January to February 2019' } | ${ 'March to April 2019' } | ${ 'Next' } | ${ 2 } | ${ { months : 2 } } | ${ 'single' }
176
176
${ 'going backward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'January to February 2019' } | ${ 'December 2018 to January 2019' } | ${ 'Previous' } | ${ 1 } | ${ { months : 2 } } | ${ 'single' }
177
177
${ 'going backward two' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'January to February 2019' } | ${ 'November to December 2018' } | ${ 'Previous' } | ${ 2 } | ${ { months : 2 } } | ${ 'single' }
178
- ` ( 'should use single $Name' , ( { defaultValue, rangeBefore, rangeAfter, rel, count, visibleDuration, pageBehavior} ) => {
178
+ ` ( 'should use pageBehavior single $Name' , ( { defaultValue, rangeBefore, rangeAfter, rel, count, visibleDuration, pageBehavior} ) => {
179
179
testPagination ( defaultValue , rangeBefore , rangeAfter , rel , count , visibleDuration , pageBehavior ) ;
180
180
} ) ;
181
+
182
+ it . each `
183
+ Name | defaultValue | rangeBefore | rangeAfter | rel | count | visibleDuration
184
+ ${ 'week going forward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'January 13 to February 2, 2019' } | ${ 'Next' } | ${ 1 } | ${ { weeks : 3 } }
185
+ ${ 'week going forward two' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'February 3 to 23, 2019' } | ${ 'Next' } | ${ 2 } | ${ { weeks : 3 } }
186
+ ${ 'week going backward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'December 2 to 22, 2018' } | ${ 'Previous' } | ${ 1 } | ${ { weeks : 3 } }
187
+ ${ 'week going backward two' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'November 11 to December 1, 2018' } | ${ 'Previous' } | ${ 2 } | ${ { weeks : 3 } }
188
+ ` ( 'should use visible as default $Name' , ( { defaultValue, rangeBefore, rangeAfter, rel, count, visibleDuration, pageBehavior} ) => {
189
+ testPagination ( defaultValue , rangeBefore , rangeAfter , rel , count , visibleDuration , pageBehavior ) ;
190
+ } ) ;
191
+
192
+ it . each `
193
+ Name | defaultValue | rangeBefore | rangeAfter | rel | count | visibleDuration | pageBehavior
194
+ ${ 'week going forward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'December 30, 2018 to January 19, 2019' } | ${ 'Next' } | ${ 1 } | ${ { weeks : 3 } } | ${ 'single' }
195
+ ${ 'week going forward four' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'January 20 to February 9, 2019' } | ${ 'Next' } | ${ 4 } | ${ { weeks : 3 } } | ${ 'single' }
196
+ ${ 'week going backward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'December 16, 2018 to January 5, 2019' } | ${ 'Previous' } | ${ 1 } | ${ { weeks : 3 } } | ${ 'single' }
197
+ ${ 'week going backward four' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 23, 2018 to January 12, 2019' } | ${ 'November 25 to December 15, 2018' } | ${ 'Previous' } | ${ 4 } | ${ { weeks : 3 } } | ${ 'single' }
198
+ ` ( 'should use pageBehavior single $Name' , ( { defaultValue, rangeBefore, rangeAfter, rel, count, visibleDuration, pageBehavior} ) => {
199
+ testPagination ( defaultValue , rangeBefore , rangeAfter , rel , count , visibleDuration , pageBehavior ) ;
200
+ } ) ;
201
+
202
+ it . each `
203
+ Name | defaultValue | rangeBefore | rangeAfter | rel | count | visibleDuration
204
+ ${ 'day going forward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'January 4 to 8, 2019' } | ${ 'Next' } | ${ 1 } | ${ { days : 5 } }
205
+ ${ 'day going forward two' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'January 9 to 13, 2019' } | ${ 'Next' } | ${ 2 } | ${ { days : 5 } }
206
+ ${ 'day going backward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'December 25 to 29, 2018' } | ${ 'Previous' } | ${ 1 } | ${ { days : 5 } }
207
+ ${ 'day going backward two' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'December 20 to 24, 2018' } | ${ 'Previous' } | ${ 2 } | ${ { days : 5 } }
208
+ ` ( 'should use visible as default $Name' , ( { defaultValue, rangeBefore, rangeAfter, rel, count, visibleDuration, pageBehavior} ) => {
209
+ testPagination ( defaultValue , rangeBefore , rangeAfter , rel , count , visibleDuration , pageBehavior ) ;
210
+ } ) ;
211
+
212
+ it . each `
213
+ Name | defaultValue | rangeBefore | rangeAfter | rel | count | visibleDuration | pageBehavior
214
+ ${ 'day going forward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'December 31, 2018 to January 4, 2019' } | ${ 'Next' } | ${ 1 } | ${ { days : 5 } } | ${ 'single' }
215
+ ${ 'day going forward five' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'January 3 to 7, 2019' } | ${ 'Next' } | ${ 4 } | ${ { days : 5 } } | ${ 'single' }
216
+ ${ 'day going backward one' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'December 29, 2018 to January 2, 2019' } | ${ 'Previous' } | ${ 1 } | ${ { days : 5 } } | ${ 'single' }
217
+ ${ 'day going backward five' } | ${ new CalendarDate ( 2019 , 1 , 1 ) } | ${ 'December 30, 2018 to January 3, 2019' } | ${ 'December 26 to 30, 2018' } | ${ 'Previous' } | ${ 4 } | ${ { days : 5 } } | ${ 'single' }
218
+ ` ( 'should use pageBehavior single $Name' , ( { defaultValue, rangeBefore, rangeAfter, rel, count, visibleDuration, pageBehavior} ) => {
219
+ testPagination ( defaultValue , rangeBefore , rangeAfter , rel , count , visibleDuration , pageBehavior ) ;
220
+ } ) ;
181
221
} ) ;
182
222
} ) ;
0 commit comments