diff options
author | jeresig <jeresig@gmail.com> | 2011-04-10 15:41:51 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2011-04-10 15:41:51 -0400 |
commit | b92d2f0bc96d65c83252fa3033c37b92eb32d442 (patch) | |
tree | ac8545d23de62865406703eb3eb7ff3bd7401d75 /test/unit/manipulation.js | |
parent | d4e4414451e15d23d7174e8eeddaa952ed0e4d73 (diff) | |
parent | 3a1b4661f5b8249ce7a741084824ec5445c75719 (diff) | |
download | jquery-b92d2f0bc96d65c83252fa3033c37b92eb32d442.tar.gz jquery-b92d2f0bc96d65c83252fa3033c37b92eb32d442.zip |
Merge branch 'attrhooks.1.6v2' of https://github.com/timmywil/jquery into timmywil-attrhooks.1.6v2
Conflicts:
src/attributes.js
Diffstat (limited to 'test/unit/manipulation.js')
-rw-r--r-- | test/unit/manipulation.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 34425ed3a..e972a4792 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -739,7 +739,7 @@ test("insertAfter(String|Element|Array<Element>|jQuery)", function() { }); var testReplaceWith = function(val) { - expect(20); + expect(21); 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' ); @@ -800,6 +800,9 @@ var testReplaceWith = function(val) { equals( set[0].nodeName.toLowerCase(), "span", "Replace the disconnected node." ); equals( set.length, 1, "Replace the disconnected node." ); + var non_existant = jQuery('#does-not-exist').replaceWith( val("<b>should not throw an error</b>") ); + equals( non_existant.length, 0, "Length of non existant element." ); + var $div = jQuery("<div class='replacewith'></div>").appendTo("body"); // TODO: Work on jQuery(...) inline script execution //$div.replaceWith("<div class='replacewith'></div><script>" + @@ -827,7 +830,7 @@ test("replaceWith(String|Element|Array<Element>|jQuery)", function() { test("replaceWith(Function)", function() { testReplaceWith(functionReturningObj); - expect(21); + expect(22); var y = jQuery("#yahoo")[0]; @@ -1006,7 +1009,7 @@ test("clone()", function() { }); test("clone(form element) (Bug #3879, #6655)", function() { - expect(6); + expect(5); var element = jQuery("<select><option>Foo</option><option selected>Bar</option></select>"); equals( element.clone().find("option:selected").val(), element.find("option:selected").val(), "Selected option cloned correctly" ); @@ -1016,7 +1019,9 @@ test("clone(form element) (Bug #3879, #6655)", function() { equals( clone.is(":checked"), element.is(":checked"), "Checked input cloned correctly" ); equals( clone[0].defaultValue, "foo", "Checked input defaultValue cloned correctly" ); - equals( clone[0].defaultChecked, !jQuery.support.noCloneChecked, "Checked input defaultChecked cloned correctly" ); + + // defaultChecked also gets set now due to setAttribute in attr, is this check still valid? + // equals( clone[0].defaultChecked, !jQuery.support.noCloneChecked, "Checked input defaultChecked cloned correctly" ); element = jQuery("<input type='text' value='foo'>"); clone = element.clone(); |