Datepicker: Fix a bad assertion - actual result is valid.

This commit is contained in:
Jörn Zaefferer 2012-02-28 15:45:24 +01:00
parent 6ba18b597a
commit e6b7486abf

View File

@ -265,7 +265,7 @@ test('miscellaneous', function() {
var curYear = new Date().getFullYear(); var curYear = new Date().getFullYear();
inp.val('02/04/2008').datepicker('show'); inp.val('02/04/2008').datepicker('show');
equals(dp.find('.ui-datepicker-year').text(), '2008', 'Year range - read-only default'); equals(dp.find('.ui-datepicker-year').text(), '2008', 'Year range - read-only default');
inp.datepicker('hide').datepicker('option', {changeYear: true}).datepicker('show'); inp.datepicker('hide').datepicker('option', {changeYear: true}).datepicker('show');
equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 10, 21), 'Year range - changeable default'); equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 10, 21), 'Year range - changeable default');
inp.datepicker('hide').datepicker('option', {yearRange: 'c-6:c+2', changeYear: true}).datepicker('show'); inp.datepicker('hide').datepicker('option', {yearRange: 'c-6:c+2', changeYear: true}).datepicker('show');
equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 6, 9), 'Year range - c-6:c+2'); equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 6, 9), 'Year range - c-6:c+2');
@ -507,11 +507,11 @@ test('altField', function() {
inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
equals(inp.val(), '', 'Alt field - dp - ctrl+end'); equals(inp.val(), '', 'Alt field - dp - ctrl+end');
equals(alt.val(), '', 'Alt field - alt - ctrl+end'); equals(alt.val(), '', 'Alt field - alt - ctrl+end');
return return
// TODO manual entry impl works (see altField demo) but this test doesn't // TODO manual entry impl works (see altField demo) but this test doesn't
// probably something the rewrite won't cover anymore anyway // probably something the rewrite won't cover anymore anyway
// Verify alt field is updated on keyup // Verify alt field is updated on keyup
alt.val(''); alt.val('');
inp.val('06/04/200').datepicker('show'); inp.val('06/04/200').datepicker('show');
@ -559,7 +559,7 @@ test('autoSize', function() {
inp.datepicker('option', 'dateFormat', 'm/d/yy'); inp.datepicker('option', 'dateFormat', 'm/d/yy');
equals(inp.prop('size'), 10, 'Auto size - he - m/d/yy'); equals(inp.prop('size'), 10, 'Auto size - he - m/d/yy');
inp.datepicker('option', 'dateFormat', 'D M d yy'); inp.datepicker('option', 'dateFormat', 'D M d yy');
equals(inp.prop('size'), 14, 'Auto size - he - D M d yy'); equals(inp.prop('size'), 16, 'Auto size - he - D M d yy');
inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy'); inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
equals(inp.prop('size'), 23, 'Auto size - he - DD, MM dd, yy'); equals(inp.prop('size'), 23, 'Auto size - he - DD, MM dd, yy');
}); });