From 54aee8cb651998361fbce05ead005c44c1cda595 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 11 Jan 2012 11:27:24 +0700 Subject: [PATCH] disable the maxTransitionWidth during testing by default so that window width doesn't conflict with tests. --- tests/unit/navigation/navigation_transitions.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit/navigation/navigation_transitions.js b/tests/unit/navigation/navigation_transitions.js index 95f4dbdc..be9533e0 100644 --- a/tests/unit/navigation/navigation_transitions.js +++ b/tests/unit/navigation/navigation_transitions.js @@ -5,6 +5,7 @@ var perspective = "viewport-flip", transitioning = "ui-mobile-viewport-transitioning", animationCompleteFn = $.fn.animationComplete, + defaultMaxTrans = $.mobile.maxTransitionWidth, //TODO centralize class names? transitionTypes = "in out fade slide flip reverse pop", @@ -18,6 +19,14 @@ isTransitioningIn = function(page){ return page.hasClass("in") && isTransitioning(page); }, + + disableMaxTransWidth = function(){ + $.mobile.maxTransitionWidth = false; + }, + + enableMaxTransWidth = function(){ + $.mobile.maxTransitionWidth = defaultMaxTrans; + }, //animationComplete callback queue fromQueue = [], @@ -46,6 +55,9 @@ module('jquery.mobile.navigation.js', { setup: function(){ + // disable this option so we can test transitions regardless of window width + disableMaxTransWidth(); + //stub to allow callback before function is returned to transition handler $.fn.animationComplete = function( callback ){ animationCompleteFn.call( this, function(){ @@ -65,6 +77,7 @@ teardown: function(){ // unmock animation complete $.fn.animationComplete = animationCompleteFn; + enableMaxTransWidth(); } });