diff options
Diffstat (limited to 'tests/unit/selectmenu/events.js')
-rw-r--r-- | tests/unit/selectmenu/events.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/unit/selectmenu/events.js b/tests/unit/selectmenu/events.js index 2ab20c46c..2d4a3f7fc 100644 --- a/tests/unit/selectmenu/events.js +++ b/tests/unit/selectmenu/events.js @@ -7,7 +7,7 @@ module( "selectmenu: events", { setup: function() { this.element = $( "#speed" ); } -}); +} ); asyncTest( "change", function() { expect( 3 ); @@ -15,15 +15,15 @@ asyncTest( "change", function() { var button, menu, options, optionIndex = 1; - this.element.selectmenu({ - change: function ( event, ui ) { + this.element.selectmenu( { + change: function( event, ui ) { equal( ui.item.index, optionIndex, "ui.item.index contains correct option index" ); equal( ui.item.element[ 0 ], options.eq( optionIndex )[ 0 ], "ui.item.element contains original option element" ); equal( ui.item.value, options.eq( optionIndex ).text(), "ui.item.value property updated correctly" ); } - }); + } ); button = this.element.selectmenu( "widget" ); menu = this.element.selectmenu( "menuWidget" ); @@ -31,23 +31,23 @@ asyncTest( "change", function() { button.simulate( "focus" ); - setTimeout(function() { + setTimeout( function() { button.trigger( "click" ); menu.find( "li" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" ); start(); - }); -}); + } ); +} ); test( "close", function() { expect( 2 ); var shouldFire; - this.element.selectmenu({ + this.element.selectmenu( { close: function() { ok( shouldFire, "close event fired on close" ); } - }); + } ); shouldFire = false; this.element.selectmenu( "open" ); @@ -57,7 +57,7 @@ test( "close", function() { this.element.selectmenu( "open" ); shouldFire = true; $( "body" ).trigger( "mousedown" ); -}); +} ); asyncTest( "focus", function() { expect( 9 ); @@ -67,20 +67,20 @@ asyncTest( "focus", function() { optionIndex = this.element[ 0 ].selectedIndex + 1, options = this.element.find( "option" ); - this.element.selectmenu({ + this.element.selectmenu( { focus: function( event, ui ) { ok( true, "focus event fired on element #" + optionIndex + " mouseover" ); equal( ui.item.index, optionIndex, "ui.item.index contains correct option index" ); equal( ui.item.element[ 0 ], options.eq( optionIndex )[ 0 ], "ui.item.element contains original option element" ); } - }); + } ); button = this.element.selectmenu( "widget" ); menu = this.element.selectmenu( "menuWidget" ); button.simulate( "focus" ); - setTimeout(function() { + setTimeout( function() { button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); button.trigger( "click" ); @@ -93,32 +93,32 @@ asyncTest( "focus", function() { // This tests for unwanted, additional focus event on close that.element.selectmenu( "close" ); start(); - }); -}); + } ); +} ); test( "open", function() { expect( 1 ); - this.element.selectmenu({ + this.element.selectmenu( { open: function() { ok( true, "open event fired on open" ); } - }); + } ); this.element.selectmenu( "open" ); -}); +} ); asyncTest( "select", function() { expect( 3 ); - this.element.selectmenu({ + this.element.selectmenu( { select: function( event, ui ) { ok( true, "select event fired on item select" ); equal( ui.item.index, optionIndex, "ui.item.index contains correct option index" ); equal( ui.item.element[ 0 ], options.eq( optionIndex )[ 0 ], "ui.item.element contains original option element" ); } - }); + } ); var button = this.element.selectmenu( "widget" ), menu = this.element.selectmenu( "menuWidget" ), @@ -126,11 +126,11 @@ asyncTest( "select", function() { optionIndex = 1; button.simulate( "focus" ); - setTimeout(function() { + setTimeout( function() { button.trigger( "click" ); menu.find( "li" ).eq( optionIndex ).simulate( "mouseover" ).trigger( "click" ); start(); - }); -}); + } ); +} ); } ); |