Skip to content

Commit 4996589

Browse files
rwaldrontimmywil
authored andcommitted
Adds test to support Sizzle getText patch for document fragments. Fixes #10864.
1 parent d700f45 commit 4996589

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/unit/manipulation.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@ var bareObj = function(value) { return value; };
77
var functionReturningObj = function(value) { return (function() { return value; }); };
88

99
test("text()", function() {
10-
expect(3);
10+
expect(4);
1111
var expected = "This link has class=\"blog\": Simon Willison's Weblog";
1212
equal( jQuery("#sap").text(), expected, "Check for merged text of more then one element." );
1313

1414
// Check serialization of text values
1515
equal( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." );
1616
notEqual( jQuery(document).text(), "", "Retrieving text for the document retrieves all text (#10724).");
17+
18+
// Retrieve from document fragments #10864
19+
var frag = document.createDocumentFragment();
20+
frag.appendChild( document.createTextNode("foo") );
21+
22+
equal( jQuery( frag ).text(), "foo", "Document Fragment Text node was retreived from .text().");
1723
});
1824

1925
test("text(undefined)", function() {
@@ -161,10 +167,10 @@ test("wrap(String) consecutive elements (#10177)", function() {
161167

162168
expect(targets.length * 2);
163169
targets.wrap("<div class='wrapper'></div>");
164-
170+
165171
targets.each(function() {
166172
var $this = jQuery(this);
167-
173+
168174
ok( $this.parent().is('.wrapper'), "Check each elements parent is correct (.wrapper)" );
169175
equal( $this.siblings().length, 0, "Each element should be wrapped individually" );
170176
});

0 commit comments

Comments
 (0)