Calendar tests: Test for using right arrow button with numberOfMonth

This commit is contained in:
Felix Nagel 2015-09-02 23:06:59 +02:00
parent 558c31ce47
commit 521604eea5

View File

@ -271,7 +271,7 @@ test( "min / max", function() {
}); });
test( "numberOfMonths", function() { test( "numberOfMonths", function() {
expect( 5 ); expect( 6 );
var date = new Date( 2015, 8 - 1, 1 ), var date = new Date( 2015, 8 - 1, 1 ),
input = $( "#calendar" ).calendar({ input = $( "#calendar" ).calendar({
numberOfMonths: 3, numberOfMonths: 3,
@ -297,12 +297,18 @@ test( "numberOfMonths", function() {
"After mousedown last month: Last day is Saturday" "After mousedown last month: Last day is Saturday"
); );
// Test if using cursor down to go to the next month advances three month // Test if using cursor to go to the next / prev month advances three month
container.find( "tbody:first td[id]:first button" ).trigger( "mousedown" ); container.find( "tbody:first td[id]:first button" ).trigger( "mousedown" );
$( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } ); $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equal( container.find( ".ui-calendar-month:first" ).text(), "May", equal( container.find( ".ui-calendar-month:first" ).text(), "May",
"After move to previous month: First month is May" "After move to previous month: First month is May"
); );
container.find( "tbody:last td[id]:last button" ).trigger( "mousedown" );
$( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
equal( container.find( ".ui-calendar-month:last" ).text(), "October",
"After move to next month: Last month is October"
);
}); });
/* /*