From 558c31ce4749198875ef97bc8858ee238cdac840 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Wed, 2 Sep 2015 22:58:22 +0200 Subject: [PATCH] Calendar tests: Add header buttons test when using date below min option --- tests/unit/calendar/options.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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() { -- 2.39.5