From 30be7d0953f884951d242146edafac50b429a587 Mon Sep 17 00:00:00 2001 From: Keith Wood Date: Wed, 23 Jul 2008 12:23:34 +0000 Subject: Tests for inline disabled datepicker --- tests/datepicker.html | 1 + tests/datepicker.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) 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 @@ 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() { -- cgit v1.2.3