expect(1);
var ac = $('#menu1').menu({
select: function(event, ui) {
- log();
+ menu_log();
}
});
- log("click",true);
- clickMenu($('#menu1'),"1");
- log("afterclick");
- clickMenu( ac,"2");
- clickMenu($('#menu1'),"3");
- clickMenu( ac,"1");
+ menu_log("click",true);
+ menu_click($('#menu1'),"1");
+ menu_log("afterclick");
+ menu_click( ac,"2");
+ menu_click($('#menu1'),"3");
+ menu_click( ac,"1");
equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid.");
});
expect(12);
var element = $('#menu1').menu({
select: function(event, ui) {
- log($(ui.item[0]).text());
+ menu_log($(ui.item[0]).text());
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
}
});
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
equals( $("#log").html(), "0,keydown,", "Keydown UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
equals( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "4,keydown,", "Keydown PAGE_DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
equals( $("#log").html(), "4,keydown,", "Keydown END");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
equals( $("#log").html(), "0,keydown,", "Keydown HOME");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
equals( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
});
expect(14);
var element = $('#menu2').menu({
select: function(event, ui) {
- log($(ui.item[0]).text());
+ menu_log($(ui.item[0]).text());
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
}
});
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
equals( $("#log").html(), "0,keydown,", "Keydown UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
}, 50);
setTimeout( function() {
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equals( $("#log").html(), "4,keydown,", "Keydown LEFT (close submenu)");
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( function() {
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "2,keydown,", "Keydown PAGE_DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
equals( $("#log").html(), "2,keydown,", "Keydown END");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
equals( $("#log").html(), "0,keydown,", "Keydown HOME");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
equals( $("#log").html(), "4,keydown,", "Keydown ESCAPE (close submenu)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
setTimeout( function() {
equals( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
equals( $("#log").html(), "Ada,keydown,", "Keydown ENTER (select item)");
expect(14);
var element = $('#menu3').menu({
select: function(event, ui) {
- log($(ui.item[0]).text());
+ menu_log($(ui.item[0]).text());
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
}
});
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
equals( $("#log").html(), "0,keydown,", "Keydown UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
equals( $("#log").html(), "keydown,", "Keydown RIGHT (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "keydown,", "Keydown PAGE_UP (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
equals( $("#log").html(), "37,keydown,", "Keydown END");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "keydown,", "Keydown PAGE_DOWN (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
equals( $("#log").html(), "0,keydown,", "Keydown HOME");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
equals( $("#log").html(), "keydown,", "Keydown ESCAPE (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER");
});
expect(14);
var element = $('#menu4').menu({
select: function(event, ui) {
- log($(ui.item[0]).text());
+ menu_log($(ui.item[0]).text());
},
focus: function( event, ui ) {
- log($(event.target).find(".ui-state-focus").parent().index());
+ menu_log($(event.target).find(".ui-state-focus").parent().index());
}
});
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
equals( $("#log").html(), "1,0,keydown,", "Keydown DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
equals( $("#log").html(), "0,keydown,", "Keydown UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equals( $("#log").html(), "keydown,", "Keydown LEFT (no effect)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
}, 50);
setTimeout( function() {
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equals( $("#log").html(), "1,keydown,", "Keydown LEFT (close submenu)");
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( function() {
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "10,keydown,", "Keydown PAGE_DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
equals( $("#log").html(), "20,keydown,", "Keydown PAGE_DOWN");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "10,keydown,", "Keydown PAGE_UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
equals( $("#log").html(), "0,keydown,", "Keydown PAGE_UP");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.END } );
equals( $("#log").html(), "27,keydown,", "Keydown END");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.HOME } );
equals( $("#log").html(), "0,keydown,", "Keydown HOME");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
equals( $("#log").html(), "1,keydown,", "Keydown ESCAPE (close submenu)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
setTimeout( function() {
equals( $("#log").html(), "0,keydown,", "Keydown ENTER (open submenu)");
- log("keydown",true);
+ menu_log("keydown",true);
element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
equals( $("#log").html(), "Aberdeen,keydown,", "Keydown ENTER (select item)");