X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fcore.js;h=d2b099678a4799749f4902f3a0a7d712bed4ed38;hb=1e750a00e988b4738e4b47b923bd78dbaffa6fb8;hp=c58f13f35e9660d0f087260c46eb0f74f35552d3;hpb=2cd9ee3510a03091c929b849ea164c9f97e262e7;p=jquery.git diff --git a/test/unit/core.js b/test/unit/core.js index c58f13f..d2b0996 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -280,10 +280,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 ); @@ -303,7 +303,7 @@ test("isXMLDoc - XML", function() { } test("jQuery('html')", function() { - expect(8); + expect(13); reset(); jQuery.foo = false; @@ -313,6 +313,14 @@ test("jQuery('html')", function() { jQuery("body").append(""); ok( jQuery.foo, "Executing a scripts contents in the right context" ); + // Test multi-line HTML + var div = jQuery("
\r\nsome text\n

some p

\nmore text\r\n
")[0]; + equals( div.nodeName.toUpperCase(), "DIV", "Make sure we're getting a div." ); + equals( div.firstChild.nodeType, 3, "Text node." ); + equals( div.lastChild.nodeType, 3, "Text node." ); + equals( div.childNodes[1].nodeType, 1, "Paragraph." ); + equals( div.childNodes[1].firstChild.nodeType, 3, "Paragraph text." ); + reset(); ok( jQuery("")[0], "Creating a link" ); @@ -329,7 +337,7 @@ test("jQuery('html')", function() { test("jQuery('html', context)", function() { expect(1); - var $div = jQuery("
"); + var $div = jQuery("
")[0]; var $span = jQuery("", $div); equals($span.length, 1, "Verify a span created with a div context works, #1763"); });