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
96ca83d1
Commit
96ca83d1
authored
May 07, 2008
by
Ariel Flesler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test runner: extra test for makeArray, related to [5481]
parent
4d41c71d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
core.js
test/unit/core.js
+5
-3
No files found.
test/unit/core.js
View file @
96ca83d1
...
@@ -264,7 +264,7 @@ test("add(String|Element|Array|undefined)", function() {
...
@@ -264,7 +264,7 @@ test("add(String|Element|Array|undefined)", function() {
expect
(
8
);
expect
(
8
);
isSet
(
$
(
"#sndp"
).
add
(
"#en"
).
add
(
"#sap"
).
get
(),
q
(
"sndp"
,
"en"
,
"sap"
),
"Check elements from document"
);
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"
);
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"
);
equals
(
$
([]).
add
(
$
(
"#form"
)[
0
].
elements
).
length
,
15
,
"Check elements from array"
);
// For the time being, we're discontinuing support for $(form.elements) since it's ambiguous in IE
// For the time being, we're discontinuing support for $(form.elements) since it's ambiguous in IE
// use $([]).add(form.elements) instead.
// use $([]).add(form.elements) instead.
...
@@ -279,7 +279,7 @@ test("add(String|Element|Array|undefined)", function() {
...
@@ -279,7 +279,7 @@ test("add(String|Element|Array|undefined)", function() {
equals
(
x
[
1
].
id
,
"x2"
,
"Check on-the-fly element2"
);
equals
(
x
[
1
].
id
,
"x2"
,
"Check on-the-fly element2"
);
var
notDefined
;
var
notDefined
;
equals
(
$
([]).
add
(
notDefined
).
length
,
0
,
"Check that undefined adds nothing
.
"
);
equals
(
$
([]).
add
(
notDefined
).
length
,
0
,
"Check that undefined adds nothing"
);
});
});
test
(
"each(Function)"
,
function
()
{
test
(
"each(Function)"
,
function
()
{
...
@@ -1619,7 +1619,7 @@ test("contents()", function() {
...
@@ -1619,7 +1619,7 @@ test("contents()", function() {
});
});
test
(
"$.makeArray"
,
function
(){
test
(
"$.makeArray"
,
function
(){
expect
(
1
4
);
expect
(
1
5
);
equals
(
$
.
makeArray
(
$
(
'html>*'
))[
0
].
nodeName
,
"HEAD"
,
"Pass makeArray a jQuery object"
);
equals
(
$
.
makeArray
(
$
(
'html>*'
))[
0
].
nodeName
,
"HEAD"
,
"Pass makeArray a jQuery object"
);
...
@@ -1649,4 +1649,6 @@ test("$.makeArray", function(){
...
@@ -1649,4 +1649,6 @@ test("$.makeArray", function(){
equals
(
$
.
makeArray
(
window
)[
0
],
window
,
"Pass makeArray the window"
);
equals
(
$
.
makeArray
(
window
)[
0
],
window
,
"Pass makeArray the window"
);
equals
(
$
.
makeArray
(
/a/
)[
0
].
constructor
,
RegExp
,
"Pass makeArray a regex"
);
equals
(
$
.
makeArray
(
/a/
)[
0
].
constructor
,
RegExp
,
"Pass makeArray a regex"
);
equals
(
$
.
makeArray
(
document
.
getElementById
(
'form'
)).
length
,
15
,
"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