aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_test_helpers.js
diff options
context:
space:
mode:
authorkborchers <kris.borchers@gmail.com>2012-04-19 11:19:52 -0500
committerkborchers <kris.borchers@gmail.com>2012-04-19 11:19:52 -0500
commitc16bd7c510cff4e0b01d9c191128af014523da7c (patch)
treefd50c26fd0a0408c0f44380a9f75dd618be2719e /tests/unit/menu/menu_test_helpers.js
parent163555d7bf27fe5d272e404de3c4439902710f54 (diff)
downloadjquery-ui-c16bd7c510cff4e0b01d9c191128af014523da7c.tar.gz
jquery-ui-c16bd7c510cff4e0b01d9c191128af014523da7c.zip
Menu tests: Don't pollute the global namespace with helpers.
Diffstat (limited to 'tests/unit/menu/menu_test_helpers.js')
-rw-r--r--tests/unit/menu/menu_test_helpers.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/unit/menu/menu_test_helpers.js b/tests/unit/menu/menu_test_helpers.js
index e83795e5a..a576af19a 100644
--- a/tests/unit/menu/menu_test_helpers.js
+++ b/tests/unit/menu/menu_test_helpers.js
@@ -1,14 +1,16 @@
-function menu_log( message, clear ) {
- if ( clear ) {
- $( "#log" ).empty();
- }
- if ( message === undefined ) {
- message = $( "#log" ).data( "lastItem" );
- }
- $( "#log" ).prepend( $.trim( message ) + "," );
-}
+TestHelpers.menu = {
+ log: function( message, clear ) {
+ if ( clear ) {
+ $( "#log" ).empty();
+ }
+ if ( message === undefined ) {
+ message = $( "#log" ).data( "lastItem" );
+ }
+ $( "#log" ).prepend( $.trim( message ) + "," );
+ },
-function menu_click( menu, item ) {
- $( "#log" ).data( "lastItem", item );
- menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
-} \ No newline at end of file
+ click: function( menu, item ) {
+ $( "#log" ).data( "lastItem", item );
+ menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
+ }
+}; \ No newline at end of file