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
67c7b46e
Commit
67c7b46e
authored
Dec 16, 2007
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding data and removeData tests
parent
feb9051c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
core.js
test/unit/core.js
+19
-1
No files found.
test/unit/core.js
View file @
67c7b46e
...
@@ -1262,6 +1262,24 @@ test("$.className", function() {
...
@@ -1262,6 +1262,24 @@ test("$.className", function() {
ok
(
c
.
has
(
x
,
"bar"
),
"Check has2"
);
ok
(
c
.
has
(
x
,
"bar"
),
"Check has2"
);
});
});
test
(
"$.data"
,
function
()
{
expect
(
3
);
var
div
=
$
(
"#foo"
)[
0
];
ok
(
jQuery
.
data
(
div
,
"test"
)
==
undefined
,
"Check for no data exists"
);
jQuery
.
data
(
div
,
"test"
,
"success"
);
ok
(
jQuery
.
data
(
div
,
"test"
)
==
"success"
,
"Check for added data"
);
jQuery
.
data
(
div
,
"test"
,
"overwritten"
);
ok
(
jQuery
.
data
(
div
,
"test"
)
==
"overwritten"
,
"Check for overwritten data"
);
});
test
(
"$.removeData"
,
function
()
{
expect
(
1
);
var
div
=
$
(
"#foo"
)[
0
];
jQuery
.
data
(
div
,
"test"
,
"testing"
);
jQuery
.
removeData
(
div
,
"test"
);
ok
(
jQuery
.
data
(
div
,
"test"
)
==
undefined
,
"Check removal of data"
);
});
test
(
"remove()"
,
function
()
{
test
(
"remove()"
,
function
()
{
expect
(
6
);
expect
(
6
);
$
(
"#ap"
).
children
().
remove
();
$
(
"#ap"
).
children
().
remove
();
...
@@ -1350,4 +1368,4 @@ test("contents()", function() {
...
@@ -1350,4 +1368,4 @@ test("contents()", function() {
var
c
=
$
(
"#nonnodes"
).
contents
().
contents
();
var
c
=
$
(
"#nonnodes"
).
contents
().
contents
();
equals
(
c
.
length
,
1
,
"Check node,textnode,comment contents is just one"
);
equals
(
c
.
length
,
1
,
"Check node,textnode,comment contents is just one"
);
equals
(
c
[
0
].
nodeValue
,
"hi"
,
"Check node,textnode,comment contents is just the one from span"
);
equals
(
c
[
0
].
nodeValue
,
"hi"
,
"Check node,textnode,comment contents is just the one from span"
);
});
});
\ 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