jquery-ui/tests/unit/menu/menu_test_helpers.js
2015-04-09 09:26:26 -04:00

34 lines
500 B
JavaScript

define( function() {
var lastItem,
log = [];
return {
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 + ")" )
.children( ".ui-menu-item-wrapper" )
.trigger( "click" );
}
};
} );