jquery-ui/tests/unit/menu/menu_test_helpers.js

32 lines
480 B
JavaScript
Raw Normal View History

2012-06-18 17:26:46 +00:00
(function() {
var lastItem,
log = [];
TestHelpers.menu = {
log: function( message, clear ) {
if ( clear ) {
2012-06-18 17:26:46 +00:00
log.length = 0;
}
if ( message === undefined ) {
2012-06-18 17:26:46 +00:00
message = lastItem;
}
log.push( $.trim( message ) );
2012-06-18 17:26:46 +00:00
},
logOutput: function() {
return log.join( "," );
2012-06-18 17:26:46 +00:00
},
clearLog: function() {
log.length = 0;
},
2011-08-04 01:15:38 +00:00
click: function( menu, item ) {
2012-06-18 17:26:46 +00:00
lastItem = item;
menu.children( ":eq(" + item + ")" ).find( "a:first" ).trigger( "click" );
}
2012-06-18 17:26:46 +00:00
};
})();