diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2013-04-07 14:40:26 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2013-04-07 14:40:26 -0400 |
commit | 2f7a4c669d1e39079bc34b61fdf5713f02d2b739 (patch) | |
tree | 3f6c070297d7dfeb6cc503968fc0c2eb5800f6d0 /tests | |
parent | 1c1b64fcf017471970c3903a2bc89cc7d108aaa3 (diff) | |
download | jquery-ui-2f7a4c669d1e39079bc34b61fdf5713f02d2b739.tar.gz jquery-ui-2f7a4c669d1e39079bc34b61fdf5713f02d2b739.zip |
Datepicker Tests: fix IE7 test failures by ensuring the datepicker is hidden before showing it.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/datepicker/datepicker_options.js | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js index c1dcfb2b7..64bbc8829 100644 --- a/tests/unit/datepicker/datepicker_options.js +++ b/tests/unit/datepicker/datepicker_options.js @@ -1050,38 +1050,40 @@ test("Ticket 6827: formatDate day of year calculation is wrong during day lights equal(time, "089"); }); -test("Ticket 7602: Stop datepicker from appearing with beforeShow event handler", function(){ +test( "Ticket 7602: Stop datepicker from appearing with beforeShow event handler", function() { expect( 3 ); - var inp = TestHelpers.datepicker.init("#inp",{ - beforeShow: function(){ - return false; - } - }), - dp = $("#ui-datepicker-div"); - inp.datepicker("show"); - equal(dp.css("display"), "none","beforeShow returns false"); - inp.datepicker("destroy"); - inp = TestHelpers.datepicker.init("#inp",{ - beforeShow: function(){ + var inp, dp; + + inp = TestHelpers.datepicker.init( "#inp", { + beforeShow: function() { } }); - dp = $("#ui-datepicker-div"); - inp.datepicker("show"); - equal(dp.css("display"), "block","beforeShow returns nothing"); - inp.datepicker("hide"); - inp.datepicker("destroy"); + dp = $( "#ui-datepicker-div" ); + inp.datepicker( "show" ); + equal( dp.css( "display" ), "block", "beforeShow returns nothing" ); + inp.datepicker( "hide" ).datepicker( "destroy" ); - inp = TestHelpers.datepicker.init("#inp",{ - beforeShow: function(){ + inp = TestHelpers.datepicker.init( "#inp", { + beforeShow: function() { return true; } }); - dp = $("#ui-datepicker-div"); - inp.datepicker("show"); - equal(dp.css("display"), "block","beforeShow returns true"); - inp.datepicker("hide"); - inp.datepicker("destroy"); + dp = $( "#ui-datepicker-div" ); + inp.datepicker( "show" ); + equal( dp.css( "display" ), "block", "beforeShow returns true" ); + inp.datepicker( "hide" ); + inp.datepicker( "destroy" ); + + inp = TestHelpers.datepicker.init( "#inp", { + beforeShow: function() { + return false; + } + }); + dp = $( "#ui-datepicker-div" ); + inp.datepicker( "show" ); + equal( dp.css( "display" ), "none","beforeShow returns false" ); + inp.datepicker( "destroy" ); }); })(jQuery); |