diff options
author | Keith Wood <kbwood.au@gmail.com> | 2008-07-23 12:23:34 +0000 |
---|---|---|
committer | Keith Wood <kbwood.au@gmail.com> | 2008-07-23 12:23:34 +0000 |
commit | 30be7d0953f884951d242146edafac50b429a587 (patch) | |
tree | e2b3962a351b8d0ee615fc80939209516dc0f968 | |
parent | 72ea968893aa0eee93e39b0d558f9cc84ad44018 (diff) | |
download | jquery-ui-30be7d0953f884951d242146edafac50b429a587.tar.gz jquery-ui-30be7d0953f884951d242146edafac50b429a587.zip |
Tests for inline disabled datepicker
-rw-r--r-- | tests/datepicker.html | 1 | ||||
-rw-r--r-- | tests/datepicker.js | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/datepicker.html b/tests/datepicker.html index e1b32ed8d..ee9d28195 100644 --- a/tests/datepicker.html +++ b/tests/datepicker.html @@ -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>
diff --git a/tests/datepicker.js b/tests/datepicker.js index 65b0ef59a..09521a45d 100644 --- a/tests/datepicker.js +++ b/tests/datepicker.js @@ -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() {
|