Skip to content

Commit

Permalink
Made some additional tests for #5785.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Jan 11, 2010
1 parent 36a98b9 commit cb4880e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/unit/manipulation.js
Expand Up @@ -626,7 +626,7 @@ test("insertAfter(String|Element|Array<Element>|jQuery)", function() {
});

var testReplaceWith = function(val) {
expect(16);
expect(17);
jQuery('#yahoo').replaceWith(val( '<b id="replace">buga</b>' ));
ok( jQuery("#replace")[0], 'Replace element with string' );
ok( !jQuery("#yahoo")[0], 'Verify that original element is gone, after string' );
Expand All @@ -651,9 +651,13 @@ var testReplaceWith = function(val) {
reset();
var tmp = jQuery("<div/>").appendTo("body").click(function(){ ok(true, "Newly bound click run." ); });
var y = jQuery('#yahoo').click(function(){ ok(true, "Previously bound click run." ); });
var child = y.append("<b>test</b>").find("b").click(function(){ ok(true, "Child bound click run." ); return false; });

y.replaceWith( tmp );

tmp.click();
y.click();
child.click();

reset();

Expand Down

0 comments on commit cb4880e

Please sign in to comment.