mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-14 17:43:10 +00:00
fixed media core failing tests
This commit is contained in:
parent
5d7938cb4e
commit
65513add72
1 changed files with 12 additions and 13 deletions
|
|
@ -7,6 +7,9 @@ var cssFn = $.fn.css,
|
|||
|
||||
// make sure original definitions are reset
|
||||
module('jquery.mobile.media.js', {
|
||||
setup: function(){
|
||||
$(document).trigger('mobileinit.htmlclass');
|
||||
},
|
||||
teardown: function(){
|
||||
$.fn.css = cssFn;
|
||||
$.fn.width = widthFn;
|
||||
|
|
@ -64,26 +67,22 @@ test( "adds all classes for default res breakpoints", function(){
|
|||
});
|
||||
});
|
||||
|
||||
test( "triggering mobile init triggers orientationchange.htmlclass", function(){
|
||||
expect( 1 );
|
||||
test( "binds remove of portrait and landscape classes resize/orientation fired", function(){
|
||||
expect( 2 );
|
||||
|
||||
$(window).bind("orientationchange.htmlclass", function(event){
|
||||
ok(event);
|
||||
$.Event.prototype.orientation = "foo";
|
||||
|
||||
$(window).bind("orientationchange.htmlclass resize.htmlclass", function(event){
|
||||
ok(!$("html").hasClass("portrait landscape"));
|
||||
start();
|
||||
});
|
||||
|
||||
$(document).trigger("mobileinit.htmlclass");
|
||||
});
|
||||
|
||||
test( "binds remove of portrait and landscape classes resize/orientation fired", function(){
|
||||
$.Event.prototype.orientation = true;
|
||||
|
||||
$("html").addClass("portrait landscape");
|
||||
$(window).trigger("resize.htmlclass");
|
||||
ok(!$("html").hasClass("portrait landscape"));
|
||||
|
||||
$("html").addClass("portrait landscape");
|
||||
$(window).trigger("resize.htmlclass");
|
||||
ok(!$("html").hasClass("portrait landscape"));
|
||||
$(window).trigger("orientationchange.htmlclass");
|
||||
stop();
|
||||
});
|
||||
|
||||
test( "sets break point class additions on resize/orientation change", function(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue