Skip to content
Permalink
Browse files

Selectmenu Tests: use trigger instead of simulate for click events in…

… order to make tests work in IE/ and IE8
  • Loading branch information
fnagel committed Jul 1, 2013
1 parent b735152 commit 2c9f5a8c01c25dd755fb60e9a80a046b9d53160e
Showing with 9 additions and 9 deletions.
  1. +3 −3 tests/unit/selectmenu/selectmenu_core.js
  2. +6 −6 tests/unit/selectmenu/selectmenu_events.js
@@ -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 } );
@@ -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 );
});

0 comments on commit 2c9f5a8

Please sign in to comment.
You can’t perform that action at this time.