From 4c199a5ce6dca5493a1bc4355d4eef9e37195404 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Sun, 13 Mar 2011 21:56:26 -0400 Subject: [PATCH] added unit test for IE version check in Mobile ( doesn't use UA detection like jQuery Core's) --- tests/unit/support/support_core.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/support/support_core.js b/tests/unit/support/support_core.js index 36c80fa3..25430f5c 100644 --- a/tests/unit/support/support_core.js +++ b/tests/unit/support/support_core.js @@ -69,6 +69,23 @@ $.testHelper.excludeFileProtocol(function(){ $.testHelper.reloadLib(libName); ok(!$.support.dynamicBaseTag); }); + + test( "jQM's IE browser check properly detects IE versions", function(){ + $.testHelper.reloadLib(libName); + + //here we're just comparing our version to what the conditional compilation finds + var ie = !!$.browser.msie, //get a boolean + version = parseInt( $.browser.version, 10), + jqmdetectedver = $.mobile.browser.ie; + + if( ie ){ + same(version, jqmdetectedver, "It's IE and the version is correct"); + } + else{ + same(ie, jqmdetectedver, "It's not IE"); + } + }); + //TODO propExists testing, refactor propExists into mockable method //TODO scrollTop testing, refactor scrollTop logic into mockable method