aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTJ VanToll <tj.vantoll@gmail.com>2014-05-01 09:57:38 -0400
committerTJ VanToll <tj.vantoll@gmail.com>2014-05-12 13:37:13 -0400
commit48001a8c46adc5d1d6c1726cecbe6453946e96e0 (patch)
tree261b2b615dc9187e439cd73c1dd4856947b576b5 /tests
parent5bbf27620504ec92cbeb3a907535f100b8d9586f (diff)
downloadjquery-ui-48001a8c46adc5d1d6c1726cecbe6453946e96e0.tar.gz
jquery-ui-48001a8c46adc5d1d6c1726cecbe6453946e96e0.zip
Autocomplete: Search if the user retypes the same value
Fixes #7434 Closes gh-1238
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/autocomplete/autocomplete_core.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/unit/autocomplete/autocomplete_core.js b/tests/unit/autocomplete/autocomplete_core.js
index 2a901006b..c306495f2 100644
--- a/tests/unit/autocomplete/autocomplete_core.js
+++ b/tests/unit/autocomplete/autocomplete_core.js
@@ -338,4 +338,25 @@ test( ".replaceWith() (#9172)", function() {
equal( parent.html().toLowerCase(), replacement );
});
+asyncTest( "Search if the user retypes the same value (#7434)", function() {
+ expect( 3 );
+ var element = $( "#autocomplete" ).autocomplete({
+ source: [ "java", "javascript" ],
+ delay: 0
+ }),
+ menu = element.autocomplete( "instance" ).menu.element;
+
+ element.val( "j" ).simulate( "keydown" );
+ setTimeout(function() {
+ ok( menu.is( ":visible" ), "menu displays initially" );
+ element.trigger( "blur" );
+ ok( !menu.is( ":visible" ), "menu hidden after blur" );
+ element.val( "j" ).simulate( "keydown" );
+ setTimeout(function() {
+ ok( menu.is( ":visible" ), "menu displays after typing the same value" );
+ start();
+ });
+ });
+});
+
}( jQuery ) );