added tests to verify that custom menu items are highlighted when they are selected

This commit is contained in:
John Bender 2011-08-10 13:54:05 -07:00
parent 6cdec7d14d
commit aad1146a65

View file

@ -293,6 +293,40 @@
], 1000);
});
asyncTest( "selected items are highlighted", function(){
$.testHelper.sequence([
function(){
// bring up the smaller choice menu
ok($("#select-choice-few-container a").length > 0, "there is in fact a button in the page");
$("#select-choice-few-container a").trigger("click");
},
function(){
var firstMenuChoice = $("#select-choice-few-menu li:first");
ok( firstMenuChoice.hasClass( $.mobile.activeBtnClass ),
"default menu choice has the active button class" );
$("#select-choice-few-menu a:last").click();
},
function(){
// bring up the menu again
$("#select-choice-few-container a").trigger("click");
},
function(){
var lastMenuChoice = $("#select-choice-few-menu li:last");
ok( lastMenuChoice.hasClass( $.mobile.activeBtnClass ),
"previously slected item has the active button class" );
// close the dialog
lastMenuChoice.find( "a" ).click();
},
start
], 1000);
});
test( "enabling and disabling", function(){
var select = $( "select" ).first(), button;