mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-05 13:14:45 +00:00
added some unit tests for maxTransitionWidth option
This commit is contained in:
parent
4125bc6756
commit
8f54d62527
1 changed files with 34 additions and 0 deletions
|
|
@ -183,5 +183,39 @@
|
|||
$.fn.animationComplete = animationCompleteFn;
|
||||
equals($("#foo").animationComplete(function(){})[0], $("#foo")[0]);
|
||||
});
|
||||
|
||||
|
||||
// reusable function for a few tests below
|
||||
function testTransitionMaxWidth( val, expected ){
|
||||
expect( 1 );
|
||||
|
||||
$.mobile.maxTransitionWidth = val;
|
||||
|
||||
var transitionOccurred = false;
|
||||
|
||||
onToComplete(function(){
|
||||
transitionOccurred = true;
|
||||
});
|
||||
|
||||
|
||||
return setTimeout(function(){
|
||||
ok( transitionOccurred === expected, (expected ? "" : "no ") + "transition occurred" );
|
||||
start();
|
||||
}, 5000);
|
||||
|
||||
$.mobile.changePage( $(".ui-page:not(.ui-page-active)").first() );
|
||||
|
||||
}
|
||||
|
||||
asyncTest( "maxTransitionWidth property disables transitions when value is less than browser width", function(){
|
||||
testTransitionMaxWidth( $( window ).width() - 1, false );
|
||||
});
|
||||
|
||||
asyncTest( "maxTransitionWidth property disables transitions when value is false", function(){
|
||||
testTransitionMaxWidth( false, false );
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
|||
Loading…
Reference in a new issue