aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/autocomplete
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-12-14 09:10:32 -0500
committerScott González <scott.gonzalez@gmail.com>2012-12-14 09:10:32 -0500
commit80e46c93a84c8720cbd4aa206c46e4ac2a2d84f7 (patch)
tree3ad9699d732489711eaec9f1651ad4ee11ad8b1a /tests/unit/autocomplete
parent2c1643509aee3cdeb0b5b7cc86a3cfa5ceb9fb60 (diff)
downloadjquery-ui-80e46c93a84c8720cbd4aa206c46e4ac2a2d84f7.tar.gz
jquery-ui-80e46c93a84c8720cbd4aa206c46e4ac2a2d84f7.zip
Autocomplete: Append to closest .ui-front if available.
Diffstat (limited to 'tests/unit/autocomplete')
-rw-r--r--tests/unit/autocomplete/autocomplete_common.js2
-rw-r--r--tests/unit/autocomplete/autocomplete_options.js8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/autocomplete/autocomplete_common.js b/tests/unit/autocomplete/autocomplete_common.js
index e1d24ef8d..63b24d384 100644
--- a/tests/unit/autocomplete/autocomplete_common.js
+++ b/tests/unit/autocomplete/autocomplete_common.js
@@ -1,6 +1,6 @@
TestHelpers.commonWidgetTests( "autocomplete", {
defaults: {
- appendTo: "body",
+ appendTo: null,
autoFocus: false,
delay: 300,
disabled: false,
diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js
index 913f5bc28..9f0bd2d43 100644
--- a/tests/unit/autocomplete/autocomplete_options.js
+++ b/tests/unit/autocomplete/autocomplete_options.js
@@ -18,11 +18,11 @@ test( "appendTo", function() {
equal( $( "#ac-wrap2 .ui-autocomplete" ).length, 0, "only appends to one element" );
element.autocomplete( "destroy" );
- element.autocomplete({
- appendTo: null
- });
- equal( element.autocomplete( "widget" ).parent()[0], document.body, "null" );
+ $( "#ac-wrap2" ).addClass( "ui-front" );
+ element.autocomplete();
+ equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap2" )[0], "null, inside .ui-front" );
element.autocomplete( "destroy" );
+ $( "#ac-wrap2" ).removeClass( "ui-front" );
element.autocomplete().autocomplete( "option", "appendTo", "#ac-wrap1" );
equal( element.autocomplete( "widget" ).parent()[0], $( "#ac-wrap1" )[0], "modified after init" );