aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_test_helpers.js
blob: b6c09ad7a9f8d778bb686893a82d2b89694a5442 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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" );
	}
};

})();