Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Adds test to support Sizzle getText patch. Addresses #10864 #661

Closed
wants to merge 1 commit into from

2 participants

Rick Waldron Timmy Willison
Rick Waldron
Collaborator

Supports: jquery/sizzle#84

Timmy Willison
Collaborator

Landed in 4996589

Timmy Willison timmywil closed this January 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 20, 2012
Rick Waldron Adds test to support Sizzle getText patch. Addresses #10864 979340f
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  test/unit/manipulation.js
12  test/unit/manipulation.js
@@ -7,13 +7,19 @@ var bareObj = function(value) { return value; };
7 7
 var functionReturningObj = function(value) { return (function() { return value; }); };
8 8
 
9 9
 test("text()", function() {
10  
-	expect(3);
  10
+	expect(4);
11 11
 	var expected = "This link has class=\"blog\": Simon Willison's Weblog";
12 12
 	equal( jQuery("#sap").text(), expected, "Check for merged text of more then one element." );
13 13
 
14 14
 	// Check serialization of text values
15 15
 	equal( jQuery(document.createTextNode("foo")).text(), "foo", "Text node was retreived from .text()." );
16 16
 	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().");
17 23
 });
18 24
 
19 25
 test("text(undefined)", function() {
@@ -161,10 +167,10 @@ test("wrap(String) consecutive elements (#10177)", function() {
161 167
 
162 168
 	expect(targets.length * 2);
163 169
 	targets.wrap("<div class='wrapper'></div>");
164  
-	
  170
+
165 171
 	targets.each(function() {
166 172
 		var $this = jQuery(this);
167  
-		
  173
+
168 174
 		ok( $this.parent().is('.wrapper'), "Check each elements parent is correct (.wrapper)" );
169 175
 		equal( $this.siblings().length, 0, "Each element should be wrapped individually" );
170 176
 	});
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.