diff options
author | Roman Salnikov <bardt.dz@gmail.com> | 2012-11-19 09:14:59 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2012-11-19 09:15:10 -0500 |
commit | 7ffcaa2e3b673e7e4178293224d5a15f65cbbcf9 (patch) | |
tree | e80345e7d8cc065e60d095009b56bf67660d87d4 /tests/unit | |
parent | cf9fbce13931732dc4b06d491ef2a01c4921faf1 (diff) | |
download | jquery-ui-7ffcaa2e3b673e7e4178293224d5a15f65cbbcf9.tar.gz jquery-ui-7ffcaa2e3b673e7e4178293224d5a15f65cbbcf9.zip |
Datepicker: reinitialize datepicker if mainDiv isn't on the page. Fixed #5679 - Datepicker should reinitialize if dpDiv is removed
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/datepicker/datepicker_core.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js index ae51b41d0..3c88059d1 100644 --- a/tests/unit/datepicker/datepicker_core.js +++ b/tests/unit/datepicker/datepicker_core.js @@ -6,6 +6,16 @@ module("datepicker: core"); +test("initialization - Reinitialization after body had been emptied.", function() { + expect( 1 ); + var bodyContent = $('body').children(), inp = $("#inp"); + $("#inp").datepicker(); + $('body').empty().append(inp); + $("#inp").datepicker(); + ok( $("#"+$.datepicker._mainDivId).length===1, "Datepicker container added" ); + $('body').empty().append(bodyContent); // Returning to initial state for later tests +}); + test( "widget method - empty collection", function() { expect( 1 ); $( "#nonExist" ).datepicker(); // should create nothing |