mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-14 19:31:02 +00:00
added test for grade a check
This commit is contained in:
parent
caf84f6663
commit
eb19f53c26
1 changed files with 20 additions and 1 deletions
|
|
@ -6,7 +6,11 @@
|
|||
var libName = "jquery.mobile.core.js",
|
||||
setGradeA = function(value) { $.support.mediaquery = value; };
|
||||
|
||||
module(libName);
|
||||
module(libName, {
|
||||
setup: function(){
|
||||
$('html').removeClass('ui-mobile');
|
||||
}
|
||||
});
|
||||
|
||||
$.testHelper.excludeFileProtocol(function(){
|
||||
|
||||
|
|
@ -29,5 +33,20 @@
|
|||
|
||||
$.testHelper.reloadLib(libName);
|
||||
});
|
||||
|
||||
test("enhancments are skipped when the browser is not grade A", function(){
|
||||
setGradeA(false);
|
||||
$.testHelper.reloadLib(libName);
|
||||
|
||||
//NOTE easiest way to check for enhancements, not the most obvious
|
||||
ok(!$("html").hasClass("ui-mobile"));
|
||||
});
|
||||
|
||||
test("enhancments are added when the browser is not grade A", function(){
|
||||
setGradeA(true);
|
||||
$.testHelper.reloadLib(libName);
|
||||
|
||||
ok($("html").hasClass("ui-mobile"));
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue