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
488e502b
Commit
488e502b
authored
Jul 30, 2012
by
Elijah Manor
Committed by
Dave Methvin
Aug 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve oldIE unit tests for fuzzy object clone. Close gh-880.
Related to the patch in gh-870.
parent
109d9107
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
manipulation.js
test/unit/manipulation.js
+28
-2
No files found.
test/unit/manipulation.js
View file @
488e502b
...
@@ -1173,7 +1173,8 @@ test("clone() (#8070)", function () {
...
@@ -1173,7 +1173,8 @@ test("clone() (#8070)", function () {
});
});
test
(
"clone()"
,
function
()
{
test
(
"clone()"
,
function
()
{
expect
(
39
);
expect
(
44
);
equal
(
"This is a normal link: Yahoo"
,
jQuery
(
"#en"
).
text
(),
"Assert text for #en"
);
equal
(
"This is a normal link: Yahoo"
,
jQuery
(
"#en"
).
text
(),
"Assert text for #en"
);
var
clone
=
jQuery
(
"#yahoo"
).
clone
();
var
clone
=
jQuery
(
"#yahoo"
).
clone
();
equal
(
"Try them out:Yahoo"
,
jQuery
(
"#first"
).
append
(
clone
).
text
(),
"Check for clone"
);
equal
(
"Try them out:Yahoo"
,
jQuery
(
"#first"
).
append
(
clone
).
text
(),
"Check for clone"
);
...
@@ -1255,7 +1256,32 @@ test("clone()", function() {
...
@@ -1255,7 +1256,32 @@ test("clone()", function() {
clone
=
div
.
clone
(
true
);
clone
=
div
.
clone
(
true
);
equal
(
clone
.
length
,
1
,
"One element cloned"
);
equal
(
clone
.
length
,
1
,
"One element cloned"
);
// equal( clone.html(), div.html(), "Element contents cloned" );
(
function
checkForAttributes
(
$
)
{
// IE6/7 adds some extra parameters so just test for existance of a defined set
var
parameters
=
[
"height"
,
"width"
,
"classid"
],
$divObject
=
div
.
find
(
"object"
),
$cloneObject
=
clone
.
find
(
"object"
);
$
.
each
(
parameters
,
function
(
index
,
parameter
)
{
equal
(
$cloneObject
.
attr
(
parameter
),
$divObject
.
attr
(
parameter
),
"Element attributes cloned: "
+
parameter
);
});
})(
jQuery
);
(
function
checkForParams
()
{
// IE6/7/8 adds a bunch of extram param elements so just test for those that are trying to clone
var
params
=
{};
clone
.
find
(
"param"
).
each
(
function
(
index
,
param
)
{
params
[
param
.
attributes
.
name
.
nodeValue
.
toLowerCase
()]
=
param
.
attributes
.
value
.
nodeValue
.
toLowerCase
();
});
div
.
find
(
"param"
).
each
(
function
(
index
,
param
)
{
var
actualValue
=
params
[
param
.
attributes
.
name
.
nodeValue
.
toLowerCase
()],
expectedValue
=
param
.
attributes
.
value
.
nodeValue
.
toLowerCase
();
equal
(
actualValue
,
expectedValue
,
"Param cloned: "
+
param
.
attributes
.
name
.
nodeValue
);
});
})();
equal
(
clone
[
0
].
nodeName
.
toUpperCase
(),
"DIV"
,
"DIV element cloned"
);
equal
(
clone
[
0
].
nodeName
.
toUpperCase
(),
"DIV"
,
"DIV element cloned"
);
// and here's a valid one.
// and here's a valid one.
...
...
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