add linkBindingEnabled tests

This commit is contained in:
John Bender 2011-10-20 15:15:49 -07:00
parent 8f5889a707
commit 1896235247

View file

@ -5,6 +5,7 @@
// TODO move siteDirectory over to the nav path helper
var changePageFn = $.mobile.changePage,
originalTitle = document.title,
originalLinkBinding = $.mobile.linkBindingEnabled,
siteDirectory = location.pathname.replace( /[^/]+$/, "" ),
home = $.mobile.path.parseUrl(location.pathname).directory,
navigateTestRoot = function(){
@ -41,6 +42,7 @@
$.mobile.urlHistory.stack = [];
$.mobile.urlHistory.activeIndex = 0;
$.Event.prototype.which = undefined;
$.mobile.linkBindingEnabled = originalLinkBinding;
}
});
@ -873,6 +875,26 @@
]);
});
asyncTest( "disabling link binding disables navigation via links and highlighting", function() {
$.mobile.linkBindingEnabled = false;
$.testHelper.pageSequence([
function() {
$.testHelper.openPage("#bar");
},
function() {
$.mobile.activePage.find( "a" ).click();
},
function( timeout ) {
ok( !$.mobile.activePage.find( "a" ).hasClass( $.mobile.activeBtnClass ), "vlick handler doesn't add the activebtn class" );
ok( timeout, "no page change was fired" );
start();
}
]);
});
asyncTest( "handling of button active state when navigating by clicking back button", 1, function(){
$.testHelper.pageSequence([
// open our test page