jquery core: Fixed #5202. Fixing selector generation when a manipulation function...
[jquery.git] / test / unit / core.js
index b6dc206..d3e0a44 100644 (file)
@@ -62,7 +62,7 @@ test("jQuery()", function() {
 });
 
 test("selector state", function() {
-       expect(30);
+       expect(31);
 
        var test;
 
@@ -126,6 +126,13 @@ test("selector state", function() {
        test = jQuery("#main").eq(0);
        equals( test.selector, "#main.slice(0,1)", "#main eq Selector" );
        equals( test.context, document, "#main eq Context" );
+       
+       var d = "<div />";
+       equals(
+               jQuery(d).appendTo(jQuery(d)).selector,
+               jQuery(d).appendTo(d).selector,
+               "manipulation methods make same selector for jQuery objects"
+       );
 });
 
 test("browser", function() {
@@ -280,10 +287,10 @@ test("isXMLDoc - HTML", function() {
        document.body.appendChild( iframe );
 
        try {
-               var body = jQuery(iframe).contents().find("body")[0];
+               var body = jQuery(iframe).contents()[0];
                ok( !jQuery.isXMLDoc( body ), "Iframe body element" );
        } catch(e){
-               ok( false, "Iframe body element" );
+               ok( false, "Iframe body element exception" );
        }
 
        document.body.removeChild( iframe );
@@ -337,7 +344,7 @@ test("jQuery('html')", function() {
 test("jQuery('html', context)", function() {
        expect(1);
 
-       var $div = jQuery("<div/>");
+       var $div = jQuery("<div/>")[0];
        var $span = jQuery("<span/>", $div);
        equals($span.length, 1, "Verify a span created with a div context works, #1763");
 });