aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/datepicker
diff options
context:
space:
mode:
authorDan Heberden <danheberden@gmail.com>2011-02-15 10:15:46 -0800
committerDan Heberden <danheberden@gmail.com>2011-02-15 10:15:46 -0800
commit5c3dc7d48ae501bd52476bfc45905130577d52c9 (patch)
tree071d9ba0a436524b5f92c261748bf9af0f32f77f /tests/unit/datepicker
parent6c3477e12e0bc924aca990eecbb1594433fb9d12 (diff)
downloadjquery-ui-5c3dc7d48ae501bd52476bfc45905130577d52c9.tar.gz
jquery-ui-5c3dc7d48ae501bd52476bfc45905130577d52c9.zip
Datepicker: prevent datepicker initialization on empty jquery collection and add unit test. Fixed #6976 - datepicker creates extra dom element with empty object
Diffstat (limited to 'tests/unit/datepicker')
-rw-r--r--tests/unit/datepicker/datepicker_core.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js
index 9867022f7..2730ec861 100644
--- a/tests/unit/datepicker/datepicker_core.js
+++ b/tests/unit/datepicker/datepicker_core.js
@@ -47,6 +47,11 @@ module("datepicker: core", {
}
});
+test( "widget method - empty collection", function() {
+ $( "#nonExist" ).datepicker(); // should create nothing
+ ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" );
+});
+
test("widget method", function() {
var actual = $("#inp").datepicker().datepicker("widget")[0];
same($("body > #ui-datepicker-div:last-child")[0], actual);