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
d0b8f9fa
Commit
d0b8f9fa
authored
Oct 30, 2013
by
Chris Antaki
Committed by
Richard Gibson
Nov 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ref
fb2e0a0c
: Synchronize unit tests with master
parent
075763b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
manipulation.js
test/unit/manipulation.js
+20
-2
No files found.
test/unit/manipulation.js
View file @
d0b8f9fa
...
...
@@ -64,9 +64,9 @@ test( "text(undefined)", function() {
function
testText
(
valueObj
)
{
expect
(
4
);
expect
(
7
);
var
val
,
j
;
var
val
,
j
,
expected
,
$multipleElements
,
$parentDiv
,
$childDiv
;
val
=
valueObj
(
"<div><b>Hello</b> cruel world!</div>"
);
equal
(
jQuery
(
"#foo"
).
text
(
val
)[
0
].
innerHTML
.
replace
(
/>/g
,
">"
),
"<div><b>Hello</b> cruel world!</div>"
,
"Check escaped text"
);
...
...
@@ -79,6 +79,24 @@ function testText( valueObj ) {
// Blackberry 4.6 doesn't maintain comments in the DOM
equal
(
jQuery
(
"#nonnodes"
)[
0
].
childNodes
.
length
<
3
?
8
:
j
[
2
].
nodeType
,
8
,
"Check node,textnode,comment with text()"
);
// Update multiple elements #11809
expected
=
"New"
;
$multipleElements
=
jQuery
(
"<div>Hello</div>"
).
add
(
"<div>World</div>"
);
$multipleElements
.
text
(
expected
);
equal
(
$multipleElements
.
eq
(
0
).
text
(),
expected
,
"text() updates multiple elements (#11809)"
);
equal
(
$multipleElements
.
eq
(
1
).
text
(),
expected
,
"text() updates multiple elements (#11809)"
);
// Prevent memory leaks #11809
$childDiv
=
jQuery
(
"<div/>"
);
$childDiv
.
data
(
"leak"
,
true
);
$parentDiv
=
jQuery
(
"<div/>"
);
$parentDiv
.
append
(
$childDiv
);
$parentDiv
.
text
(
"Dry off"
);
equal
(
$childDiv
.
data
(
"leak"
),
undefined
,
"Check for leaks (#11809)"
);
}
test
(
"text(String)"
,
function
()
{
...
...
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