Permalink
Browse files

Added some currently failing tests for expected behavior in issue #3735

  • Loading branch information...
1 parent 453979f commit 599426fbfbf6d6104ad270f85721d0a87ea61e78 scottjehl committed Mar 5, 2012
Showing with 58 additions and 0 deletions.
  1. +20 −0 tests/unit/dialog/dialog_events.js
  2. +38 −0 tests/unit/page/page_core.js
View
20 tests/unit/dialog/dialog_events.js
@@ -123,4 +123,24 @@
}
]);
});
+
+
+ asyncTest( "page container is updated to dialog overlayTheme at pagebeforeshow", function(){
+
+ expect( 1 );
+
+ var pageTheme = "ui-overlay-" + $.mobile.activePage.dialog( "option", "overlayTheme" );
+
+ $.mobile.pageContainer.removeClass( pageTheme );
+
+ $.mobile.activePage
+ .bind( "pagebeforeshow", function(){
+ ok( $.mobile.pageContainer.hasClass( pageTheme ), "Page container has the same theme as the dialog overlayTheme on pagebeforeshow" );
+ start();
+ })
+ .trigger( "pagebeforeshow" );
+
+ } );
+
+
})( jQuery );
View
38 tests/unit/page/page_core.js
@@ -116,4 +116,42 @@
$.mobile.ignoreContentEnabled = false;
});
+
+
+ asyncTest( "page container is updated to page theme at pagebeforeshow", function(){
+
+ expect( 1 );
+
+ var pageTheme = "ui-overlay-" + $.mobile.activePage.page( "option", "theme" );
+
+ $.mobile.pageContainer.removeClass( pageTheme );
+
+ $.mobile.activePage
+ .bind( "pagebeforeshow", function(){
+ ok( $.mobile.pageContainer.hasClass( pageTheme ), "Page container has the same theme as the page on pagebeforeshow" );
+ start();
+ })
+ .trigger( "pagebeforeshow" );
+
+ } );
+
+ asyncTest( "page container is updated to page theme at pagebeforeshow", function(){
+
+ expect( 1 );
+
+ var pageTheme = "ui-overlay-" + $.mobile.activePage.page( "option", "theme" );
+
+ $.mobile.pageContainer.addClass( pageTheme );
+
+ $.mobile.activePage
+ .bind( "pagebeforehide", function(){
+ ok( !$.mobile.pageContainer.hasClass( pageTheme ), "Page container does not have the same theme as the page on pagebeforeshow" );
+ start();
+ })
+ .trigger( "pagebeforehide" );
+
+ } );
+
+
+
})(jQuery);

0 comments on commit 599426f

Please sign in to comment.