aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2012-01-20 16:47:49 -0500
committertimmywil <timmywillisn@gmail.com>2012-01-20 16:47:49 -0500
commit499658970b2c9add7a7d175dffc8e263c3b7b50d (patch)
tree833aed367738a8ab5f7b88d3d16655ceb59f6bb6
parentd700f458d7cb38bbd6b8c1a74f3c8af9d63947f7 (diff)
downloadjquery-499658970b2c9add7a7d175dffc8e263c3b7b50d.tar.gz
jquery-499658970b2c9add7a7d175dffc8e263c3b7b50d.zip
Adds test to support Sizzle getText patch for document fragments. Fixes #10864.
-rw-r--r--test/unit/manipulation.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index 44bb9110c..6f7077320 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -7,13 +7,19 @@ var bareObj = function(value) { return value; };
var functionReturningObj = function(value) { return (function() { return value; }); };
test("text()", function() {
- expect(3);
+ expect(4);
var expected = "This link has class=\"blog\": Simon Willison's Weblog";
equal( jQuery("#sap").text(), expected, "Check for merged text of more then one element." );
// Check serialization of text values
equal( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." );
notEqual( jQuery(document).text(), "", "Retrieving text for the document retrieves all text (#10724).");
+
+ // Retrieve from document fragments #10864
+ var frag = document.createDocumentFragment();
+ frag.appendChild( document.createTextNode("foo") );
+
+ equal( jQuery( frag ).text(), "foo", "Document Fragment Text node was retreived from .text().");
});
test("text(undefined)", function() {
@@ -161,10 +167,10 @@ test("wrap(String) consecutive elements (#10177)", function() {
expect(targets.length * 2);
targets.wrap("<div class='wrapper'></div>");
-
+
targets.each(function() {
var $this = jQuery(this);
-
+
ok( $this.parent().is('.wrapper'), "Check each elements parent is correct (.wrapper)" );
equal( $this.siblings().length, 0, "Each element should be wrapped individually" );
});