]> source.dussan.org Git - jquery-ui.git/commitdiff
Added test for #3664 - Dialog init fails on disconnected DOM Element after .remove()
authorRichard Worth <rdworth@gmail.com>
Sat, 13 Dec 2008 10:57:10 +0000 (10:57 +0000)
committerRichard Worth <rdworth@gmail.com>
Sat, 13 Dec 2008 10:57:10 +0000 (10:57 +0000)
tests/dialog.js

index 95e123a920c67be8496dafb27a3f626009db923e..438db2e9d3263c2d09d815c8b874223beaf5b88f 100644 (file)
@@ -115,7 +115,7 @@ function margin(el, side) {
 module("dialog");
 
 test("init", function() {
-       expect(6);
+       expect(7);
 
        $("<div></div>").appendTo('body').dialog().remove();
        ok(true, '.dialog() called on element');
@@ -124,7 +124,10 @@ test("init", function() {
        ok(true, '.dialog() called on empty collection');
 
        $('<div></div>').dialog().remove();
-       ok(true, '.dialog() called on disconnected DOMElement');
+       ok(true, '.dialog() called on disconnected DOMElement - never connected');
+
+       $('<div></div>').appendTo('body').remove().dialog().remove();
+       ok(true, '.dialog() called on disconnected DOMElement - removed');
 
        $('<div></div>').dialog().dialog("foo").remove();
        ok(true, 'arbitrary method called after init');