]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu Tests: use trigger instead of simulate for click events in order to make...
authorFelix Nagel <info@felixnagel.com>
Mon, 1 Jul 2013 20:04:30 +0000 (22:04 +0200)
committerFelix Nagel <info@felixnagel.com>
Mon, 1 Jul 2013 20:04:30 +0000 (22:04 +0200)
tests/unit/selectmenu/selectmenu_core.js
tests/unit/selectmenu/selectmenu_events.js

index c4f43b681c32e1bed49242894a76791100391289..e6cbcbeed8cea0784dfdbe47ecb7943bd904ccf3 100644 (file)
@@ -100,7 +100,7 @@ $.each([
                setTimeout(function() {
                        links = menu.find("li.ui-menu-item a");
 
-                       button.simulate( "click" );
+                       button.trigger( "click" );
                        menu.find( "a" ).last().simulate( "mouseover" ).trigger( "click" );
                        equal(
                                menu.attr( "aria-activedescendant" ),
@@ -137,10 +137,10 @@ $.each([
                setTimeout(function() {
                        links = menu.find( "li.ui-menu-item a" );
                        // open menu and click first item
-                       button.simulate( "click" );
+                       button.trigger( "click" );
                        links.first().simulate( "mouseover" ).trigger( "click" );
                        // open menu again and hover item
-                       button.simulate( "click" );
+                       button.trigger( "click" );
                        links.eq( 3 ).simulate( "mouseover" );
                        // close and use keyboard control on button
                        button.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
index 572f502e88f100990988fd04c848ff2829871648..353780ee5308c4cc77a48655d3509eabe20311e4 100644 (file)
@@ -29,8 +29,8 @@ asyncTest( "change", function () {
        button.simulate( "focus" );
 
        setTimeout(function() {
-               button.simulate( "click" );
-               menu.find( "a" ).eq( optionIndex ).simulate( "mouseover" ).simulate( "click" );
+               button.trigger( "click" );
+               menu.find( "a" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" );
                start();
        }, 1 );
 });
@@ -49,7 +49,7 @@ test( "close", function () {
        this.element.selectmenu( "open" ).selectmenu( "close" );
 
        this.element.selectmenu( "open" );
-       $( "body" ).simulate( "click" );
+       $( "body" ).trigger( "click" );
 });
 
 
@@ -78,7 +78,7 @@ asyncTest( "focus", function () {
        setTimeout(function() {
                button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
 
-               button.simulate( "click" );
+               button.trigger( "click" );
                links = menu.find( "li.ui-menu-item a" );
                optionIndex = 0;
                links.eq( optionIndex ).simulate( "mouseover" );
@@ -126,8 +126,8 @@ asyncTest( "select", function () {
        button.simulate( "focus" );
 
        setTimeout(function() {
-               button.simulate( "click" );
-               menu.find( "a" ).eq( optionIndex ).simulate( "mouseover" ).simulate( "click" );
+               button.trigger( "click" );
+               menu.find( "a" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" );
                start();
        }, 1 );
 });