From e5f9028ea70ca35c212e4dbcebcba85006256eb5 Mon Sep 17 00:00:00 2001 From: John Bender Date: Fri, 19 Nov 2010 00:34:44 -0800 Subject: [PATCH] first media query break point class addition test --- tests/unit/media/media_core.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/unit/media/media_core.js b/tests/unit/media/media_core.js index c6235eb1..33b4eae8 100644 --- a/tests/unit/media/media_core.js +++ b/tests/unit/media/media_core.js @@ -3,12 +3,14 @@ */ (function( $ ) { - var css_fn = $.fn.css; + var cssFn = $.fn.css, + widthFn = $.fn.width; - // make sure the original definition is replaced + // make sure original definitions are reset module('mobile.media', { teardown: function(){ - $.fn.css = css_fn; + $.fn.css = cssFn; + $.fn.width = widthFn; } }); @@ -33,4 +35,11 @@ $.fn.css = function(){ return "not absolute"; }; same($.mobile.media('screen 3'), true); }); + + test( "adding breakpoints adds the appropriate width classes", function(){ + $.fn.width = function(){ return 120; }; + + $.mobile.addResolutionBreakpoints(125); + ok($('html').hasClass('max-width-125px')); + }); })(jQuery); \ No newline at end of file