Dialog: Add unit test to cover #8789 and #8838.

This commit is contained in:
Kris Borchers 2012-11-24 23:18:51 -06:00 committed by Jörn Zaefferer
parent 7e9060c109
commit a68d5ca31d

View File

@ -325,4 +325,20 @@ test("beforeClose", function() {
el.remove();
});
// #8789 and #8838
asyncTest("ensure dialog's container doesn't scroll on resize and focus", function() {
expect(2);
var el = $('#dialog1').dialog(),
initialScroll = $(window).scrollTop();
el.dialog('option', 'height', 600);
equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after height change");
setTimeout( function(){
$(".ui-dialog-titlebar-close").simulate('mousedown');
equal($(window).scrollTop(), initialScroll, "scroll hasn't moved after focus moved to dialog");
el.dialog('destroy');
start();
}, 500);
});
})(jQuery);