Skip to content

Commit

Permalink
Dialog: Add unit test to cover #8789 and #8838.
Browse files Browse the repository at this point in the history
  • Loading branch information
kborchers authored and jzaefferer committed Nov 26, 2012
1 parent 7e9060c commit a68d5ca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/unit/dialog/dialog_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit a68d5ca

Please sign in to comment.