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
9db710a1
Commit
9db710a1
authored
Jan 19, 2009
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made some tweaks to the core tests so that they'll run better under XHTML.
parent
04977b8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
core.js
test/unit/core.js
+5
-5
No files found.
test/unit/core.js
View file @
9db710a1
...
@@ -778,8 +778,8 @@ test("wrap(String|Element)", function() {
...
@@ -778,8 +778,8 @@ test("wrap(String|Element)", function() {
// Try wrapping a disconnected node
// Try wrapping a disconnected node
j
=
jQuery
(
"<label/>"
).
wrap
(
"<li/>"
);
j
=
jQuery
(
"<label/>"
).
wrap
(
"<li/>"
);
equals
(
j
[
0
].
nodeName
,
"LABEL"
,
"Element is a label"
);
equals
(
j
[
0
].
nodeName
.
toUpperCase
()
,
"LABEL"
,
"Element is a label"
);
equals
(
j
[
0
].
parentNode
.
nodeName
,
"LI"
,
"Element has been wrapped"
);
equals
(
j
[
0
].
parentNode
.
nodeName
.
toUpperCase
()
,
"LI"
,
"Element has been wrapped"
);
});
});
test
(
"wrapAll(String|Element)"
,
function
()
{
test
(
"wrapAll(String|Element)"
,
function
()
{
...
@@ -1377,7 +1377,7 @@ test("html(String)", function() {
...
@@ -1377,7 +1377,7 @@ test("html(String)", function() {
// this is needed, or the expando added by jQuery unique will yield a different html
// this is needed, or the expando added by jQuery unique will yield a different html
j
.
find
(
'b'
).
removeData
();
j
.
find
(
'b'
).
removeData
();
equals
(
j
.
html
().
toLowerCase
(),
"<b>bold</b>"
,
"Check node,textnode,comment with html()"
);
equals
(
j
.
html
().
replace
(
/ xmlns="
[^
"
]
+"/g
,
""
).
toLowerCase
(),
"<b>bold</b>"
,
"Check node,textnode,comment with html()"
);
jQuery
(
"#main"
).
html
(
"<select/>"
);
jQuery
(
"#main"
).
html
(
"<select/>"
);
jQuery
(
"#main select"
).
html
(
"<option>O1</option><option selected='selected'>O2</option><option>O3</option>"
);
jQuery
(
"#main select"
).
html
(
"<option>O1</option><option selected='selected'>O2</option><option>O3</option>"
);
...
@@ -1791,7 +1791,7 @@ test("contents()", function() {
...
@@ -1791,7 +1791,7 @@ test("contents()", function() {
test
(
"jQuery.makeArray"
,
function
(){
test
(
"jQuery.makeArray"
,
function
(){
expect
(
15
);
expect
(
15
);
equals
(
jQuery
.
makeArray
(
jQuery
(
'html>*'
))[
0
].
nodeName
,
"HEAD"
,
"Pass makeArray a jQuery object"
);
equals
(
jQuery
.
makeArray
(
jQuery
(
'html>*'
))[
0
].
nodeName
.
toUpperCase
()
,
"HEAD"
,
"Pass makeArray a jQuery object"
);
equals
(
jQuery
.
makeArray
(
document
.
getElementsByName
(
"PWD"
)).
slice
(
0
,
1
)[
0
].
name
,
"PWD"
,
"Pass makeArray a nodelist"
);
equals
(
jQuery
.
makeArray
(
document
.
getElementsByName
(
"PWD"
)).
slice
(
0
,
1
)[
0
].
name
,
"PWD"
,
"Pass makeArray a nodelist"
);
...
@@ -1807,7 +1807,7 @@ test("jQuery.makeArray", function(){
...
@@ -1807,7 +1807,7 @@ test("jQuery.makeArray", function(){
equals
(
jQuery
.
makeArray
(
true
)[
0
].
constructor
,
Boolean
,
"Pass makeArray a boolean"
);
equals
(
jQuery
.
makeArray
(
true
)[
0
].
constructor
,
Boolean
,
"Pass makeArray a boolean"
);
equals
(
jQuery
.
makeArray
(
document
.
createElement
(
"div"
)
)[
0
].
nodeName
,
"DIV"
,
"Pass makeArray a single node"
);
equals
(
jQuery
.
makeArray
(
document
.
createElement
(
"div"
)
)[
0
].
nodeName
.
toUpperCase
()
,
"DIV"
,
"Pass makeArray a single node"
);
equals
(
jQuery
.
makeArray
(
{
length
:
2
,
0
:
"a"
,
1
:
"b"
}
).
join
(
""
),
"ab"
,
"Pass makeArray an array like map (with length)"
);
equals
(
jQuery
.
makeArray
(
{
length
:
2
,
0
:
"a"
,
1
:
"b"
}
).
join
(
""
),
"ab"
,
"Pass makeArray an array like map (with length)"
);
...
...
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