aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_events.js
diff options
context:
space:
mode:
authorKris Borchers <kris.borchers@gmail.com>2012-11-24 23:18:51 -0600
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 12:14:29 +0100
commita68d5ca31d764a737653461cfba49debdc8ad0ba (patch)
treef9cd3155a299159ed0fd337fc1e2b196a553d835 /tests/unit/dialog/dialog_events.js
parent7e9060c109b928769a664dbcc2c17bd21231b6f3 (diff)
downloadjquery-ui-a68d5ca31d764a737653461cfba49debdc8ad0ba.tar.gz
jquery-ui-a68d5ca31d764a737653461cfba49debdc8ad0ba.zip
Dialog: Add unit test to cover #8789 and #8838.
Diffstat (limited to 'tests/unit/dialog/dialog_events.js')
-rw-r--r--tests/unit/dialog/dialog_events.js16
1 files changed, 16 insertions, 0 deletions
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);