aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog
diff options
context:
space:
mode:
authorJay Merrifield <merrifieldj@pixia.com>2010-11-12 08:16:41 -0500
committerScott González <scott.gonzalez@gmail.com>2010-11-12 08:16:41 -0500
commitdfb35442975a95c91f6c28188fad021714d7098b (patch)
tree381e657c01b1739f12d3439b5955cce9bf9fcd16 /tests/unit/dialog
parent320dfb86790571358db4a46d5b9d2a8278cf6024 (diff)
downloadjquery-ui-dfb35442975a95c91f6c28188fad021714d7098b.tar.gz
jquery-ui-dfb35442975a95c91f6c28188fad021714d7098b.zip
Dialog: Make sure the overlay instance still exists before trying to remove it. Fixes #6645 - Dialog: Missing element not found check in overlay code.
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r--tests/unit/dialog/dialog_tickets.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js
index f7b590b53..b9bf2f972 100644
--- a/tests/unit/dialog/dialog_tickets.js
+++ b/tests/unit/dialog/dialog_tickets.js
@@ -76,6 +76,16 @@ test("#6137: dialog('open') causes form elements to reset on IE7", function() {
equal($('input:checked').val(), 'b', "checkbox b is checked");
d1.add(d2).remove();
-})
+});
+
+test("#6645: Missing element not found check in overlay", function(){
+ expect(2);
+ d1 = $('<div title="dialog 1">Dialog 1</div>').dialog({modal: true});
+ d2 = $('<div title="dialog 2">Dialog 2</div>').dialog({modal: true, close: function(){ d2.remove()}});
+ equals($.ui.dialog.overlay.instances.length, 2, 'two overlays created');
+ d2.dialog('close');
+ equals($.ui.dialog.overlay.instances.length, 1, 'one overlay remains after closing the 2nd overlay');
+ d1.add(d2).remove();
+});
})(jQuery);