Skip to content

Commit d2a8e12

Browse files
committed
Calendar tests: Test for using right arrow button with numberOfMonth
1 parent 1b7d33f commit d2a8e12

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/unit/calendar/options.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ test( "min / max", function() {
271271
});
272272

273273
test( "numberOfMonths", function() {
274-
expect( 5 );
274+
expect( 6 );
275275
var date = new Date( 2015, 8 - 1, 1 ),
276276
input = $( "#calendar" ).calendar({
277277
numberOfMonths: 3,
@@ -297,12 +297,18 @@ test( "numberOfMonths", function() {
297297
"After mousedown last month: Last day is Saturday"
298298
);
299299

300-
// Test if using cursor down to go to the next month advances three month
300+
// Test if using cursor to go to the next / prev month advances three month
301301
container.find( "tbody:first td[id]:first button" ).trigger( "mousedown" );
302302
$( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
303303
equal( container.find( ".ui-calendar-month:first" ).text(), "May",
304304
"After move to previous month: First month is May"
305305
);
306+
307+
container.find( "tbody:last td[id]:last button" ).trigger( "mousedown" );
308+
$( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
309+
equal( container.find( ".ui-calendar-month:last" ).text(), "October",
310+
"After move to next month: Last month is October"
311+
);
306312
});
307313

308314
/*

0 commit comments

Comments
 (0)