]> source.dussan.org Git - jquery-ui.git/commitdiff
Tests for inline disabled datepicker
authorKeith Wood <kbwood.au@gmail.com>
Wed, 23 Jul 2008 12:23:34 +0000 (12:23 +0000)
committerKeith Wood <kbwood.au@gmail.com>
Wed, 23 Jul 2008 12:23:34 +0000 (12:23 +0000)
tests/datepicker.html
tests/datepicker.js

index e1b32ed8d403e97554f09d31747a5d6484353c80..ee9d28195554bcd255c1928a23a1540af210bbc3 100644 (file)
@@ -17,6 +17,7 @@
        <script type="text/javascript" src="datepicker.js"></script>\r
 \r
        <style type="text/css">\r
+               @import "../themes/flora/flora.datepicker.css";\r
                .xerror, .error { display: none }\r
        </style>\r
 </head>\r
index 65b0ef59a50e14d8e27457a13b8b59e464bc60fb..09521a45d8ae5a77c82a0a797272a3ea791c783e 100644 (file)
@@ -480,6 +480,23 @@ test('enableDisable', function() {
        ok(!inp[0].disabled, 'Enable/disable image - field now enabled');\r
        ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image now enabled');\r
        inp.datepicker('destroy');\r
+       // Inline\r
+       var inl = init('#inl');\r
+       ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled');\r
+       ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover initially absent');\r
+       inl.datepicker('disable');\r
+       ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled');\r
+       var disabled = $('.ui-datepicker-disabled', inl);\r
+       var dp = $('.ui-datepicker-inline', inl);\r
+       ok(disabled.length == 1, 'Enable/disable inline - cover now present');\r
+       ok(disabled.offset().top == dp.offset().top && disabled.offset().left == dp.offset().left,\r
+               'Enable/disable inline - cover positioning');\r
+       ok(disabled.width() == dp.width() && disabled.height() == dp.height(),\r
+               'Enable/disable inline - cover sizing');\r
+       inl.datepicker('enable');\r
+       ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled');\r
+       ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover now absent');\r
+       inl.datepicker('destroy');\r
 });\r
 \r
 test('keystrokes', function() {\r