diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-12-07 11:58:58 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-12-07 11:58:58 -0500 |
commit | da17a232ca554254eabd3583805b381f6b525ec5 (patch) | |
tree | 29004625020ea375198fb4379c713eff8b7cd2ca /tests | |
parent | 1481b080121bf15ef60f30162c345f0423f3986f (diff) | |
download | jquery-ui-da17a232ca554254eabd3583805b381f6b525ec5.tar.gz jquery-ui-da17a232ca554254eabd3583805b381f6b525ec5.zip |
Autocomplete: Handle detached elements for appendTo after create.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/autocomplete/autocomplete_options.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit/autocomplete/autocomplete_options.js b/tests/unit/autocomplete/autocomplete_options.js index d3a25d2fc..913f5bc28 100644 --- a/tests/unit/autocomplete/autocomplete_options.js +++ b/tests/unit/autocomplete/autocomplete_options.js @@ -5,7 +5,7 @@ module( "autocomplete: options" ); var data = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl" ]; test( "appendTo", function() { - expect( 7 ); + expect( 8 ); var detached = $( "<div>" ), element = $( "#autocomplete" ).autocomplete(); equal( element.autocomplete( "widget" ).parent()[0], document.body, "defaults to body" ); @@ -39,6 +39,10 @@ test( "appendTo", function() { }); equal( element.autocomplete( "widget" ).parent()[0], detached[0], "detached DOM element" ); element.autocomplete( "destroy" ); + + element.autocomplete().autocomplete( "option", "appendTo", detached ); + equal( element.autocomplete( "widget" ).parent()[0], detached[0], "detached DOM element via option()" ); + element.autocomplete( "destroy" ); }); function autoFocusTest( afValue, focusedLength ) { |