mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-04 12:54:41 +00:00
add linkBindingEnabled tests
This commit is contained in:
parent
8f5889a707
commit
1896235247
1 changed files with 22 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue