From: Kris Borchers Date: Sun, 25 Nov 2012 05:18:51 +0000 (-0600) Subject: Dialog: Add unit test to cover #8789 and #8838. X-Git-Tag: 1.10.0-beta.1~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a68d5ca31d764a737653461cfba49debdc8ad0ba;p=jquery-ui.git Dialog: Add unit test to cover #8789 and #8838. --- diff --git a/tests/unit/dialog/dialog_events.js b/tests/unit/dialog/dialog_events.js index eeb17eb93..cbeced0f8 100644 --- a/tests/unit/dialog/dialog_events.js +++ b/tests/unit/dialog/dialog_events.js @@ -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);