]> source.dussan.org Git - jquery-ui.git/commitdiff
Menu tests: Don't pollute the global namespace with helpers.
authorkborchers <kris.borchers@gmail.com>
Thu, 19 Apr 2012 16:19:52 +0000 (11:19 -0500)
committerkborchers <kris.borchers@gmail.com>
Thu, 19 Apr 2012 16:19:52 +0000 (11:19 -0500)
grunt.js
tests/unit/menu/menu_events.js
tests/unit/menu/menu_methods.js
tests/unit/menu/menu_options.js
tests/unit/menu/menu_test_helpers.js

index 78303180d4295a26656efdcb9ddcdd61bf0c944a..33ae33829519f68ef56c7accebe0a280efea8aa8 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -368,8 +368,6 @@ grunt.initConfig({
                                        init: true,
                                        isNotOpen: true,
                                        isOpen: true,
-                                       menu_click: true,
-                                       menu_log: true,
                                        modal: true,
                                        module: true,
                                        moved: true,
index dccb5f7a2fec7dea98317b00eb131b979e1a3446..a0051c70b1e02c737d5b6fcdcdcc96d5040eb3a3 100644 (file)
@@ -3,21 +3,24 @@
  */
 (function($) {
 
+var log = TestHelpers.menu.log,
+       click = TestHelpers.menu.click;
+
 module("menu: events");
 
 test("handle click on menu", function() {
        expect(1);
        var menu = $('#menu1').menu({
                select: function(event, ui) {
-                       menu_log();
+                       log();
                }
        });
-       menu_log("click",true);
-       menu_click($('#menu1'),"1");
-       menu_log("afterclick");
-       menu_click( menu,"2");
-       menu_click($('#menu1'),"3");
-       menu_click( menu,"1");
+       log("click",true);
+       click($('#menu1'),"1");
+       log("afterclick");
+       click( menu,"2");
+       click($('#menu1'),"3");
+       click( menu,"1");
        equal( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
 });
 
@@ -25,16 +28,16 @@ test("handle click on custom item menu", function() {
        expect(1);
        var menu = $('#menu5').menu({
                select: function(event, ui) {
-                       menu_log();
+                       log();
                },
                menus: "div"
        });
-       menu_log("click",true);
-       menu_click($('#menu5'),"1");
-       menu_log("afterclick");
-       menu_click( menu,"2");
-       menu_click($('#menu5'),"3");
-       menu_click( menu,"1");
+       log("click",true);
+       click($('#menu5'),"1");
+       log("afterclick");
+       click( menu,"2");
+       click($('#menu5'),"3");
+       click( menu,"1");
        equal( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
 });
 
@@ -75,7 +78,7 @@ test( "handle blur on custom item menu: click", function() {
                items: "div"
        });
 
-       menu_click($('#menu5'),"1");
+       click($('#menu5'),"1");
        $( "<a>", { id: "remove"} ).appendTo("body").trigger( "click" );
 
        $("#remove").remove();
@@ -144,60 +147,60 @@ test("handle keyboard navigation on menu without scroll and without submenus", f
        expect(12);
        var element = $('#menu1').menu({
                select: function(event, ui) {
-                       menu_log($(ui.item[0]).text());
+                       log($(ui.item[0]).text());
                },
                focus: function( event, ui ) {
-                       menu_log($(event.target).find(".ui-state-focus").parent().index());
+                       log($(event.target).find(".ui-state-focus").parent().index());
                }
        });
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.focus();
        element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
        element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
        equal( $("#log").html(), "2,1,0,keydown,", "Keydown DOWN");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
        equal( $("#log").html(), "1,keydown,", "Keydown UP");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
        equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
        equal( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
        equal( $("#log").html(), "4,keydown,", "Keydown PAGE_DOWN");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
        equal( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
        equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
        equal( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
        equal( $("#log").html(), "4,keydown,", "Keydown END");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
        equal( $("#log").html(), "0,keydown,", "Keydown HOME");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
        equal( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
        equal( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
 });
@@ -206,14 +209,14 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
        expect(14);
        var element = $('#menu2').menu({
                select: function(event, ui) {
-                       menu_log($(ui.item[0]).text());
+                       log($(ui.item[0]).text());
                },
                focus: function( event, ui ) {
-                       menu_log($(event.target).find(".ui-state-focus").parent().index());
+                       log($(event.target).find(".ui-state-focus").parent().index());
                }
        });
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.one( "menufocus", function( event, ui ) {
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
@@ -223,16 +226,16 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
        element.focus();
 
        function menukeyboard1() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
                equal( $("#log").html(), "0,1,keydown,", "Keydown UP");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
                equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
@@ -246,7 +249,7 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
        }
 
        function menukeyboard2() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
                equal( $("#log").html(), "4,keydown,", "Keydown LEFT (close submenu)");
 
@@ -256,35 +259,35 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
        }
 
        function menukeyboard3() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
                equal( $("#log").html(), "2,keydown,", "Keydown PAGE_DOWN");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
                equal( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
                equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
                equal( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
                equal( $("#log").html(), "2,keydown,", "Keydown END");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
                equal( $("#log").html(), "0,keydown,", "Keydown HOME");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
                equal( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
                setTimeout( menukeyboard4, 50 );
        }
@@ -292,7 +295,7 @@ asyncTest("handle keyboard navigation on menu without scroll and with submenus",
        function menukeyboard4() {
                equal( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
                equal( $("#log").html(), "Ada,keydown,", "Keydown ENTER (select item)");
 
@@ -304,69 +307,69 @@ test("handle keyboard navigation on menu with scroll and without submenus", func
        expect(14);
        var element = $('#menu3').menu({
                select: function(event, ui) {
-                       menu_log($(ui.item[0]).text());
+                       log($(ui.item[0]).text());
                },
                focus: function( event, ui ) {
-                       menu_log($(event.target).find(".ui-state-focus").parent().index());
+                       log($(event.target).find(".ui-state-focus").parent().index());
                }
        });
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.focus();
        element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
        element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
        equal( $("#log").html(), "2,1,0,keydown,", "Keydown DOWN");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
        element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
        equal( $("#log").html(), "0,1,keydown,", "Keydown UP");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
        equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
        equal( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
        equal( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
        equal( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
        equal( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
        equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
        equal( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
        equal( $("#log").html(), "37,keydown,", "Keydown END");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
        equal( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
        equal( $("#log").html(), "0,keydown,", "Keydown HOME");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
        equal( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
        equal( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
 });
@@ -375,14 +378,14 @@ asyncTest("handle keyboard navigation on menu with scroll and with submenus", fu
        expect(14);
        var element = $('#menu4').menu({
                select: function(event, ui) {
-                       menu_log($(ui.item[0]).text());
+                       log($(ui.item[0]).text());
                },
                focus: function( event, ui ) {
-                       menu_log($(event.target).find(".ui-state-focus").parent().index());
+                       log($(event.target).find(".ui-state-focus").parent().index());
                }
        });
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.one( "menufocus", function( event, ui ) {
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
@@ -393,16 +396,16 @@ asyncTest("handle keyboard navigation on menu with scroll and with submenus", fu
 
 
        function menukeyboard1() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
                equal( $("#log").html(), "0,1,keydown,", "Keydown UP");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
                equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
 
@@ -413,7 +416,7 @@ asyncTest("handle keyboard navigation on menu with scroll and with submenus", fu
        }
 
        function menukeyboard2() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
                equal( $("#log").html(), "1,keydown,", "Keydown LEFT (close submenu)");
 
@@ -423,35 +426,35 @@ asyncTest("handle keyboard navigation on menu with scroll and with submenus", fu
        }
 
        function menukeyboard3() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
                equal( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
                equal( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
                equal( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
                equal( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
                equal( $("#log").html(), "27,keydown,", "Keydown END");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
                equal( $("#log").html(), "0,keydown,", "Keydown HOME");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
                equal( $("#log").html(), "1,keydown,", "Keydown ESCAPE (close submenu)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
                setTimeout( menukeyboard4, 50 );
        }
@@ -459,7 +462,7 @@ asyncTest("handle keyboard navigation on menu with scroll and with submenus", fu
        function menukeyboard4() {
                equal( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
                equal( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER (select item)");
 
@@ -471,14 +474,14 @@ asyncTest("handle keyboard navigation and mouse click on menu with disabled item
        expect(6);
        var element = $('#menu6').menu({
                select: function(event, ui) {
-                       menu_log($(ui.item[0]).text());
+                       log($(ui.item[0]).text());
                },
                focus: function( event, ui ) {
-                       menu_log($(event.target).find(".ui-state-focus").parent().index());
+                       log($(event.target).find(".ui-state-focus").parent().index());
                }
        });
 
-       menu_log("keydown",true);
+       log("keydown",true);
        element.one( "menufocus", function( event, ui ) {
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
@@ -489,29 +492,29 @@ asyncTest("handle keyboard navigation and mouse click on menu with disabled item
 
 
        function menukeyboard1() {
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                equal( $("#log").html(), "4,3,2,keydown,", "Keydown focus disabled item with submenu");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
                equal( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
 
-               menu_log("keydown",true);
+               log("keydown",true);
                element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
 
                setTimeout( function() {
                        equal( $("#log").html(), "keydown,", "Keydown RIGHT (no effect on disabled sub-menu)");
 
-                       menu_log("keydown",true);
+                       log("keydown",true);
                        element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
 
                        setTimeout( function() {
                                equal( $("#log").html(), "keydown,", "Keydown ENTER (no effect on disabled sub-menu)");
-                               menu_log("click",true);
-                               menu_click( element, "1" );
+                               log("click",true);
+                               click( element, "1" );
                                equal( $("#log").html(), "click,", "Click disabled item (no effect)");
                                start();
                        }, 50);
index 200ea4427b8832bb74843eedb60c24bc7d0d51f4..6ad7bc13411a4e0cf70156477ec8e88c57f4d01f 100644 (file)
@@ -3,25 +3,28 @@
  */
 (function($) {
 
+var log = TestHelpers.menu.log,
+       click = TestHelpers.menu.click;
+
 module("menu: methods");
 
 test( "enable/disable", function() {
        expect( 3 );
        var menu = $( "#menu1" ).menu({
                select: function(event, ui) {
-                       menu_log();
+                       log();
                }
        });
        menu.menu("disable");
        ok(menu.is(".ui-state-disabled"),"Missing ui-state-disabled class");
-       menu_log("click",true);
-       menu_click(menu,"1");
-       menu_log("afterclick");
+       log("click",true);
+       click(menu,"1");
+       log("afterclick");
        menu.menu("enable");
        ok(menu.not(".ui-state-disabled"),"Has ui-state-disabled class");
-       menu_log("click");
-       menu_click(menu,"1");
-       menu_log("afterclick");
+       log("click");
+       click(menu,"1");
+       log("afterclick");
        equal( $("#log").html(), "afterclick,1,click,afterclick,click,", "Click order not valid.");
 });
 
index cda52d88d8687d7d859db02fd925ef6d111e7918..e651fd2d11988ea9ead19f1fff1ff3f0d70bc96e 100644 (file)
@@ -3,6 +3,9 @@
  */
 (function($) {
 
+var log = TestHelpers.menu.log,
+       click = TestHelpers.menu.click;
+
 module("menu: options");
 
 test( "{ disabled: true }", function() {
@@ -10,13 +13,13 @@ test( "{ disabled: true }", function() {
        var menu = $( "#menu1" ).menu({
                disabled: true,
                select: function(event, ui) {
-                       menu_log();
+                       log();
                }
        });
        ok(menu.is(".ui-state-disabled"),"Missing ui-state-disabled class");
-       menu_log("click",true);
-       menu_click(menu,"1");
-       menu_log("afterclick");
+       log("click",true);
+       click(menu,"1");
+       log("afterclick");
        equal( $("#log").html(), "afterclick,click,", "Click order not valid.");
 });
 
@@ -25,13 +28,13 @@ test( "{ disabled: false }", function() {
        var menu = $( "#menu1" ).menu({
                disabled: false,
                select: function(event, ui) {
-                       menu_log();
+                       log();
                }
        });
        ok(menu.not(".ui-state-disabled"),"Has ui-state-disabled class");
-       menu_log("click",true);
-       menu_click(menu,"1");
-       menu_log("afterclick");
+       log("click",true);
+       click(menu,"1");
+       log("afterclick");
        equal( $("#log").html(), "afterclick,1,click,", "Click order not valid.");
 });
 
index e83795e5a5763d420d420066cfc497cbe4679c07..a576af19a5588ed409826dbb838378cca3d8fe82 100644 (file)
@@ -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