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
ed291938
Commit
ed291938
authored
Nov 25, 2013
by
Jakob Stoeck
Committed by
Richard Gibson
Nov 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit tests for .html( number ). Close gh-1447.
parent
b407bdde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
manipulation.js
test/unit/manipulation.js
+6
-3
No files found.
test/unit/manipulation.js
View file @
ed291938
...
...
@@ -94,7 +94,7 @@ function testText( valueObj ) {
$parentDiv
=
jQuery
(
"<div/>"
);
$parentDiv
.
append
(
$childDiv
);
$parentDiv
.
text
(
"Dry off"
);
equal
(
$childDiv
.
data
(
"leak"
),
undefined
,
"Check for leaks (#11809)"
);
}
...
...
@@ -1333,7 +1333,7 @@ function childNodeNames( node ) {
}
function
testHtml
(
valueObj
)
{
expect
(
37
);
expect
(
40
);
var
actual
,
expected
,
tmp
,
div
=
jQuery
(
"<div></div>"
),
...
...
@@ -1353,6 +1353,9 @@ function testHtml( valueObj ) {
equal
(
div
.
html
(
valueObj
(
5
)).
html
(),
"5"
,
"Setting a number as html"
);
equal
(
div
.
html
(
valueObj
(
0
)).
html
(),
"0"
,
"Setting a zero as html"
);
equal
(
div
.
html
(
valueObj
(
Infinity
)).
html
(),
"Infinity"
,
"Setting Infinity as html"
);
equal
(
div
.
html
(
valueObj
(
NaN
)).
html
(),
""
,
"Setting NaN as html"
);
equal
(
div
.
html
(
valueObj
(
1
e2
)).
html
(),
"100"
,
"Setting exponential number notation as html"
);
div
.
html
(
valueObj
(
" &"
)
);
equal
(
...
...
@@ -1438,7 +1441,7 @@ function testHtml( valueObj ) {
ok
(
/^
[^
<
]
*
[^
<
\s][^
<
]
*$/
.
test
(
fixture
.
html
()
),
"Replace html with text"
);
}
test
(
"html(String)"
,
function
()
{
test
(
"html(String
|Number
)"
,
function
()
{
testHtml
(
manipulationBareObj
);
});
...
...
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