From: Felix Nagel Date: Wed, 2 Sep 2015 20:58:22 +0000 (+0200) Subject: Calendar tests: Add header buttons test when using date below min option X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=558c31ce4749198875ef97bc8858ee238cdac840;p=jquery-ui.git Calendar tests: Add header buttons test when using date below min option --- diff --git a/tests/unit/calendar/options.js b/tests/unit/calendar/options.js index 86eb6492f..62390813a 100644 --- a/tests/unit/calendar/options.js +++ b/tests/unit/calendar/options.js @@ -191,7 +191,7 @@ test( "showWeek", function() { }); test( "min / max", function() { - expect( 14 ); + expect( 17 ); // With existing date var element = $( "#calendar" ).calendar(), @@ -253,11 +253,21 @@ test( "min / max", function() { .calendar( "option", { max: null } ) .calendar( "value", "1/4/09" ) .calendar( "option", { min: minDate, max: maxDate } ); - ok( nextButton.hasClass( "ui-state-disabled" ), "Other year: Next button disabled" ); + ok( nextButton.hasClass( "ui-state-disabled" ), "Other year above max: Next button disabled" ); prevButton.simulate( "click" ); - ok( nextButton.hasClass( "ui-state-disabled" ), "Other year: Next button disabled after click" ); + ok( nextButton.hasClass( "ui-state-disabled" ), "Other year above max: Next button disabled after click" ); prevButton.simulate( "click" ); - ok( !nextButton.hasClass( "ui-state-disabled" ), "Other year: Next button enabled after click" ); + ok( !nextButton.hasClass( "ui-state-disabled" ), "Other year above max: Next button enabled after click" ); + + element + .calendar( "option", { min: null } ) + .calendar( "value", "1/4/08" ) + .calendar( "option", { min: minDate, max: maxDate } ); + ok( prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button disabled" ); + nextButton.simulate( "click" ); + ok( prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button disabled after click" ); + nextButton.simulate( "click" ); + ok( !prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button enabled after click" ); }); test( "numberOfMonths", function() {