Commit 49965897 authored by Rick Waldron's avatar Rick Waldron Committed by timmywil

Adds test to support Sizzle getText patch for document fragments. Fixes #10864.

parent d700f458
...@@ -7,13 +7,19 @@ var bareObj = function(value) { return value; }; ...@@ -7,13 +7,19 @@ var bareObj = function(value) { return value; };
var functionReturningObj = function(value) { return (function() { return value; }); }; var functionReturningObj = function(value) { return (function() { return value; }); };
test("text()", function() { test("text()", function() {
expect(3); expect(4);
var expected = "This link has class=\"blog\": Simon Willison's Weblog"; 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." ); equal( jQuery("#sap").text(), expected, "Check for merged text of more then one element." );
// Check serialization of text values // Check serialization of text values
equal( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." ); 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)."); 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() { test("text(undefined)", function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment