Tests for inline disabled datepicker

This commit is contained in:
Keith Wood 2008-07-23 12:23:34 +00:00
parent 72ea968893
commit 30be7d0953
2 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,7 @@
<script type="text/javascript" src="datepicker.js"></script>
<style type="text/css">
@import "../themes/flora/flora.datepicker.css";
.xerror, .error { display: none }
</style>
</head>

View File

@ -480,6 +480,23 @@ test('enableDisable', function() {
ok(!inp[0].disabled, 'Enable/disable image - field now enabled');
ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image now enabled');
inp.datepicker('destroy');
// Inline
var inl = init('#inl');
ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled');
ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover initially absent');
inl.datepicker('disable');
ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled');
var disabled = $('.ui-datepicker-disabled', inl);
var dp = $('.ui-datepicker-inline', inl);
ok(disabled.length == 1, 'Enable/disable inline - cover now present');
ok(disabled.offset().top == dp.offset().top && disabled.offset().left == dp.offset().left,
'Enable/disable inline - cover positioning');
ok(disabled.width() == dp.width() && disabled.height() == dp.height(),
'Enable/disable inline - cover sizing');
inl.datepicker('enable');
ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled');
ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover now absent');
inl.datepicker('destroy');
});
test('keystrokes', function() {