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
a073ee85
Commit
a073ee85
authored
May 16, 2009
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unit tests for setting cellspacing, rowspan, and colspan
parent
fd281e49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
attributes.js
test/unit/attributes.js
+10
-1
No files found.
test/unit/attributes.js
View file @
a073ee85
...
@@ -77,7 +77,7 @@ test("attr(Hash)", function() {
...
@@ -77,7 +77,7 @@ test("attr(Hash)", function() {
});
});
test
(
"attr(String, Object)"
,
function
()
{
test
(
"attr(String, Object)"
,
function
()
{
expect
(
2
1
);
expect
(
2
4
);
var
div
=
jQuery
(
"div"
).
attr
(
"foo"
,
"bar"
),
var
div
=
jQuery
(
"div"
).
attr
(
"foo"
,
"bar"
),
fail
=
false
;
fail
=
false
;
for
(
var
i
=
0
;
i
<
div
.
size
();
i
++
)
{
for
(
var
i
=
0
;
i
<
div
.
size
();
i
++
)
{
...
@@ -105,6 +105,15 @@ test("attr(String, Object)", function() {
...
@@ -105,6 +105,15 @@ test("attr(String, Object)", function() {
jQuery
(
"#name"
).
attr
(
'maxLength'
,
'10'
);
jQuery
(
"#name"
).
attr
(
'maxLength'
,
'10'
);
equals
(
document
.
getElementById
(
'name'
).
maxLength
,
'10'
,
'Set maxlength attribute'
);
equals
(
document
.
getElementById
(
'name'
).
maxLength
,
'10'
,
'Set maxlength attribute'
);
var
table
=
jQuery
(
'#table'
).
append
(
"<tr><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr><tr><td>cell</td><td>cell</td></tr>"
),
td
=
table
.
find
(
'td:first'
);
td
.
attr
(
"rowspan"
,
"2"
);
equals
(
td
[
0
].
rowSpan
,
2
,
"Check rowspan is correctly set"
);
td
.
attr
(
"colspan"
,
"2"
);
equals
(
td
[
0
].
colSpan
,
2
,
"Check colspan is correctly set"
);
table
.
attr
(
"cellspacing"
,
"2"
);
equals
(
table
[
0
].
cellSpacing
,
2
,
"Check cellspacing is correctly set"
);
// for #1070
// for #1070
jQuery
(
"#name"
).
attr
(
'someAttr'
,
'0'
);
jQuery
(
"#name"
).
attr
(
'someAttr'
,
'0'
);
equals
(
jQuery
(
"#name"
).
attr
(
'someAttr'
),
'0'
,
'Set attribute to a string of "0"'
);
equals
(
jQuery
(
"#name"
).
attr
(
'someAttr'
),
'0'
,
'Set attribute to a string of "0"'
);
...
...
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