jquery-ui/tests/unit/menu/helper.js
Scott González bde431bb44 Tests: Rename files
Ref gh-1528
2015-04-09 09:27:00 -04:00

37 lines
561 B
JavaScript

define( [
"jquery",
"lib/helper"
], function( $, helper ) {
var lastItem,
log = [];
return $.extend( helper, {
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" );
}
} );
} );