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
6a9b73c7
Commit
6a9b73c7
authored
May 08, 2008
by
Ariel Flesler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test runner: extra tests for $.fn.add enabled by [5503] and a small fix for an html() test.
parent
487567e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
core.js
test/unit/core.js
+11
-2
No files found.
test/unit/core.js
View file @
6a9b73c7
...
...
@@ -261,7 +261,7 @@ test("get(Number)", function() {
});
test
(
"add(String|Element|Array|undefined)"
,
function
()
{
expect
(
8
);
expect
(
12
);
isSet
(
$
(
"#sndp"
).
add
(
"#en"
).
add
(
"#sap"
).
get
(),
q
(
"sndp"
,
"en"
,
"sap"
),
"Check elements from document"
);
isSet
(
$
(
"#sndp"
).
add
(
$
(
"#en"
)[
0
]
).
add
(
$
(
"#sap"
)
).
get
(),
q
(
"sndp"
,
"en"
,
"sap"
),
"Check elements from document"
);
ok
(
$
([]).
add
(
$
(
"#form"
)[
0
].
elements
).
length
>=
13
,
"Check elements from array"
);
...
...
@@ -280,6 +280,12 @@ test("add(String|Element|Array|undefined)", function() {
var
notDefined
;
equals
(
$
([]).
add
(
notDefined
).
length
,
0
,
"Check that undefined adds nothing"
);
// Added after #2811
equals
(
$
([]).
add
([
window
,
document
,
document
.
body
,
document
]).
length
,
3
,
"Pass an array"
);
equals
(
$
(
document
).
add
(
document
).
length
,
1
,
"Check duplicated elements"
);
equals
(
$
(
window
).
add
(
window
).
length
,
1
,
"Check duplicated elements using the window"
);
ok
(
$
([]).
add
(
document
.
getElementById
(
'form'
)
).
length
>=
13
,
"Add a form (adds the elements)"
);
});
test
(
"each(Function)"
,
function
()
{
...
...
@@ -1148,6 +1154,9 @@ test("html(String)", function() {
// using contents will get comments regular, text, and comment nodes
var
j
=
$
(
"#nonnodes"
).
contents
();
j
.
html
(
"<b>bold</b>"
);
// this is needed, or the expando added by jQuery unique will yield a different html
j
.
find
(
'b'
).
removeData
();
equals
(
j
.
html
().
toLowerCase
(),
"<b>bold</b>"
,
"Check node,textnode,comment with html()"
);
$
(
"#main"
).
html
(
"<select/>"
);
...
...
@@ -1651,4 +1660,4 @@ test("$.makeArray", function(){
equals
(
$
.
makeArray
(
/a/
)[
0
].
constructor
,
RegExp
,
"Pass makeArray a regex"
);
ok
(
$
.
makeArray
(
document
.
getElementById
(
'form'
)).
length
>=
13
,
"Pass makeArray a form (treat as elements)"
);
});
\ No newline at end of file
});
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