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
2746d7f2
Commit
2746d7f2
authored
Mar 09, 2011
by
cmcnulty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move embed tests to area where objects tests are already happening
parent
4aafe727
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
manipulation.js
test/unit/manipulation.js
+11
-15
No files found.
test/unit/manipulation.js
View file @
2746d7f2
...
@@ -898,7 +898,7 @@ test("clone() (#8070)", function () {
...
@@ -898,7 +898,7 @@ test("clone() (#8070)", function () {
});
});
test
(
"clone()"
,
function
()
{
test
(
"clone()"
,
function
()
{
expect
(
37
);
expect
(
40
);
equals
(
'This is a normal link: Yahoo'
,
jQuery
(
'#en'
).
text
(),
'Assert text for #en'
);
equals
(
'This is a normal link: Yahoo'
,
jQuery
(
'#en'
).
text
(),
'Assert text for #en'
);
var
clone
=
jQuery
(
'#yahoo'
).
clone
();
var
clone
=
jQuery
(
'#yahoo'
).
clone
();
equals
(
'Try them out:Yahoo'
,
jQuery
(
'#first'
).
append
(
clone
).
text
(),
'Check for clone'
);
equals
(
'Try them out:Yahoo'
,
jQuery
(
'#first'
).
append
(
clone
).
text
(),
'Check for clone'
);
...
@@ -965,6 +965,14 @@ test("clone()", function() {
...
@@ -965,6 +965,14 @@ test("clone()", function() {
cloneEvt
.
remove
();
cloneEvt
.
remove
();
divEvt
.
remove
();
divEvt
.
remove
();
// Test both html() and clone() for <embed and <object types
div
=
jQuery
(
"<div/>"
).
html
(
'<embed height="355" width="425" src="http://www.youtube.com/v/3KANI2dpXLw&hl=en"></embed>'
);
clone
=
div
.
clone
(
true
);
equals
(
clone
.
length
,
1
,
"One element cloned"
);
equals
(
clone
.
html
(),
div
.
html
(),
"Element contents cloned"
);
equals
(
clone
[
0
].
nodeName
.
toUpperCase
(),
"DIV"
,
"DIV element cloned"
);
// this is technically an invalid object, but because of the special
// this is technically an invalid object, but because of the special
// classid instantiation it is the only kind that IE has trouble with,
// classid instantiation it is the only kind that IE has trouble with,
// so let's test with it too.
// so let's test with it too.
...
@@ -1053,7 +1061,7 @@ test("clone() on XML nodes", function() {
...
@@ -1053,7 +1061,7 @@ test("clone() on XML nodes", function() {
}
}
var
testHtml
=
function
(
valueObj
)
{
var
testHtml
=
function
(
valueObj
)
{
expect
(
3
5
);
expect
(
3
1
);
jQuery
.
scriptorder
=
0
;
jQuery
.
scriptorder
=
0
;
...
@@ -1081,18 +1089,6 @@ var testHtml = function(valueObj) {
...
@@ -1081,18 +1089,6 @@ var testHtml = function(valueObj) {
QUnit
.
reset
();
QUnit
.
reset
();
jQuery
(
"#main"
).
html
(
valueObj
(
"<embed src='data/cow.jpg'></embed>"
));
ok
((
jQuery
(
"#main"
).
children
().
length
>
0
),
"Make sure there is a child EMBED element."
);
equals
(
jQuery
(
"#main"
).
children
()[
0
].
nodeName
.
toUpperCase
(),
"EMBED"
,
"And that an embed element was inserted."
);
QUnit
.
reset
();
jQuery
(
"#main"
).
html
(
valueObj
(
"<object data='data/cow.jpg'></object>"
));
equals
(
jQuery
(
"#main"
).
children
().
length
,
1
,
"Make sure there is a child OBJECT element."
);
equals
(
jQuery
(
"#main"
).
children
()[
0
].
nodeName
.
toUpperCase
(),
"OBJECT"
,
"And that an object element was inserted."
);
QUnit
.
reset
();
// using contents will get comments regular, text, and comment nodes
// using contents will get comments regular, text, and comment nodes
var
j
=
jQuery
(
"#nonnodes"
).
contents
();
var
j
=
jQuery
(
"#nonnodes"
).
contents
();
j
.
html
(
valueObj
(
"<b>bold</b>"
));
j
.
html
(
valueObj
(
"<b>bold</b>"
));
...
@@ -1141,7 +1137,7 @@ test("html(String)", function() {
...
@@ -1141,7 +1137,7 @@ test("html(String)", function() {
test
(
"html(Function)"
,
function
()
{
test
(
"html(Function)"
,
function
()
{
testHtml
(
functionReturningObj
);
testHtml
(
functionReturningObj
);
expect
(
3
7
);
expect
(
3
3
);
QUnit
.
reset
();
QUnit
.
reset
();
...
...
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