imported the whole jquery-ui package, refreshed with 1.10.2
[unfold.git] / third-party / jquery-ui-1.10.2 / tests / unit / menu / menu_test_helpers.js
diff --git a/third-party/jquery-ui-1.10.2/tests/unit/menu/menu_test_helpers.js b/third-party/jquery-ui-1.10.2/tests/unit/menu/menu_test_helpers.js
new file mode 100644 (file)
index 0000000..b6c09ad
--- /dev/null
@@ -0,0 +1,31 @@
+(function() {
+
+var lastItem,
+       log = [];
+
+TestHelpers.menu = {
+       log: function( message, clear ) {
+               if ( clear ) {
+                       log.length = 0;
+               }
+               if ( message === undefined ) {
+                       message = lastItem;
+               }
+               log.push( $.trim( message ) );
+       },
+
+       logOutput: function() {
+               return log.join( "," );
+       },
+
+       clearLog: function() {
+               log.length = 0;
+       },
+
+       click: function( menu, item ) {
+               lastItem = item;
+               menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
+       }
+};
+
+})();