Skip to content

Commit 1b7d33f

Browse files
committed
Calendar tests: Add header buttons test when using date below min option
1 parent 3469e5b commit 1b7d33f

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/unit/calendar/options.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ test( "showWeek", function() {
191191
});
192192

193193
test( "min / max", function() {
194-
expect( 14 );
194+
expect( 17 );
195195

196196
// With existing date
197197
var element = $( "#calendar" ).calendar(),
@@ -253,11 +253,21 @@ test( "min / max", function() {
253253
.calendar( "option", { max: null } )
254254
.calendar( "value", "1/4/09" )
255255
.calendar( "option", { min: minDate, max: maxDate } );
256-
ok( nextButton.hasClass( "ui-state-disabled" ), "Other year: Next button disabled" );
256+
ok( nextButton.hasClass( "ui-state-disabled" ), "Other year above max: Next button disabled" );
257257
prevButton.simulate( "click" );
258-
ok( nextButton.hasClass( "ui-state-disabled" ), "Other year: Next button disabled after click" );
258+
ok( nextButton.hasClass( "ui-state-disabled" ), "Other year above max: Next button disabled after click" );
259259
prevButton.simulate( "click" );
260-
ok( !nextButton.hasClass( "ui-state-disabled" ), "Other year: Next button enabled after click" );
260+
ok( !nextButton.hasClass( "ui-state-disabled" ), "Other year above max: Next button enabled after click" );
261+
262+
element
263+
.calendar( "option", { min: null } )
264+
.calendar( "value", "1/4/08" )
265+
.calendar( "option", { min: minDate, max: maxDate } );
266+
ok( prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button disabled" );
267+
nextButton.simulate( "click" );
268+
ok( prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button disabled after click" );
269+
nextButton.simulate( "click" );
270+
ok( !prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button enabled after click" );
261271
});
262272

263273
test( "numberOfMonths", function() {

0 commit comments

Comments
 (0)