diff options
author | Jay Merrifield <fracmak@gmail.com> | 2012-11-13 21:07:48 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-11-13 21:08:55 -0500 |
commit | eca5abd873675f5cc7b96641c723b7e35a4260bc (patch) | |
tree | c1c05684840a278617ec6121781bb76cf7ffc278 /tests/unit | |
parent | 2553d61384a89a7aa3fcea2f185c2c7ec45d2bd1 (diff) | |
download | jquery-ui-eca5abd873675f5cc7b96641c723b7e35a4260bc.tar.gz jquery-ui-eca5abd873675f5cc7b96641c723b7e35a4260bc.zip |
Datepicker: Updated the range tests so you can't navigate past the yearRange. Fixes #7362 - Datepicker allows changing year to something outside yearRange
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/datepicker/datepicker_options.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js index 9078a2374..7d2b070fa 100644 --- a/tests/unit/datepicker/datepicker_options.js +++ b/tests/unit/datepicker/datepicker_options.js @@ -322,9 +322,10 @@ test('miscellaneous', function() { }); test('minMax', function() { - expect( 17 ); + expect( 19 ); var date, inp = TestHelpers.datepicker.init('#inp'), + dp = $('#ui-datepicker-div'), lastYear = new Date(2007, 6 - 1, 4), nextYear = new Date(2009, 6 - 1, 4), minDate = new Date(2008, 2 - 1, 29), @@ -404,6 +405,11 @@ test('minMax', function() { TestHelpers.datepicker.equalsDate(inp.datepicker('getDate'), new Date(2008, 6 - 1, 4), 'Min/max - setDate > min, < max'); inp.datepicker('option', {maxDate: null}).val('01/04/2009').datepicker('option', {minDate: minDate, maxDate: maxDate}); TestHelpers.datepicker.equalsDate(inp.datepicker('getDate'), maxDate, 'Min/max - setDate > max'); + + inp.datepicker('option', {yearRange: '-0:+1'}).val('01/01/' + new Date().getFullYear()); + ok(dp.find(".ui-datepicker-prev").hasClass("ui-state-disabled"), "Year Range Test - previous button disabled at 1/1/minYear"); + inp.datepicker("setDate", "12/30/" + new Date().getFullYear()); + ok(dp.find(".ui-datepicker-next").hasClass("ui-state-disabled"), "Year Range Test - next button disabled at 12/30/maxYear"); }); test('setDate', function() { |