Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
49965897
Commit
49965897
authored
Jan 20, 2012
by
Rick Waldron
Committed by
timmywil
Jan 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds test to support Sizzle getText patch for document fragments. Fixes #10864.
parent
d700f458
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
manipulation.js
test/unit/manipulation.js
+9
-3
No files found.
test/unit/manipulation.js
View file @
49965897
...
@@ -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
()
{
...
@@ -161,10 +167,10 @@ test("wrap(String) consecutive elements (#10177)", function() {
...
@@ -161,10 +167,10 @@ test("wrap(String) consecutive elements (#10177)", function() {
expect
(
targets
.
length
*
2
);
expect
(
targets
.
length
*
2
);
targets
.
wrap
(
"<div class='wrapper'></div>"
);
targets
.
wrap
(
"<div class='wrapper'></div>"
);
targets
.
each
(
function
()
{
targets
.
each
(
function
()
{
var
$this
=
jQuery
(
this
);
var
$this
=
jQuery
(
this
);
ok
(
$this
.
parent
().
is
(
'.wrapper'
),
"Check each elements parent is correct (.wrapper)"
);
ok
(
$this
.
parent
().
is
(
'.wrapper'
),
"Check each elements parent is correct (.wrapper)"
);
equal
(
$this
.
siblings
().
length
,
0
,
"Each element should be wrapped individually"
);
equal
(
$this
.
siblings
().
length
,
0
,
"Each element should be wrapped individually"
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment