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
e06da172
Commit
e06da172
authored
Mar 22, 2009
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving dimension related unit tests to dimensions test module
parent
d7d908b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
56 deletions
+56
-56
attributes.js
test/unit/attributes.js
+0
-56
dimensions.js
test/unit/dimensions.js
+56
-0
No files found.
test/unit/attributes.js
View file @
e06da172
...
...
@@ -232,62 +232,6 @@ test("attr('tabindex', value)", function() {
equals
(
element
.
attr
(
'tabindex'
),
-
1
,
'set negative tabindex'
);
});
test
(
"width()"
,
function
()
{
expect
(
6
);
var
$div
=
jQuery
(
"#nothiddendiv"
);
$div
.
width
(
30
);
equals
(
$div
.
width
(),
30
,
"Test set to 30 correctly"
);
$div
.
hide
();
equals
(
$div
.
width
(),
30
,
"Test hidden div"
);
$div
.
show
();
$div
.
width
(
-
1
);
// handle negative numbers by ignoring #1599
equals
(
$div
.
width
(),
30
,
"Test negative width ignored"
);
$div
.
css
(
"padding"
,
"20px"
);
equals
(
$div
.
width
(),
30
,
"Test padding specified with pixels"
);
$div
.
css
(
"border"
,
"2px solid #fff"
);
equals
(
$div
.
width
(),
30
,
"Test border specified with pixels"
);
//$div.css("padding", "2em");
//equals($div.width(), 30, "Test padding specified with ems");
//$div.css("border", "1em solid #fff");
//DISABLED - Opera 9.6 fails this test, returns 8
//equals($div.width(), 30, "Test border specified with ems");
//$div.css("padding", "2%");
//equals($div.width(), 30, "Test padding specified with percent");
$div
.
css
({
display
:
""
,
border
:
""
,
padding
:
""
});
jQuery
(
"#nothiddendivchild"
).
css
({
padding
:
"3px"
,
border
:
"2px solid #fff"
});
equals
(
jQuery
(
"#nothiddendivchild"
).
width
(),
20
,
"Test child width with border and padding"
);
jQuery
(
"#nothiddendiv, #nothiddendivchild"
).
css
({
border
:
""
,
padding
:
""
,
width
:
""
});
});
test
(
"height()"
,
function
()
{
expect
(
5
);
var
$div
=
jQuery
(
"#nothiddendiv"
);
$div
.
height
(
30
);
equals
(
$div
.
height
(),
30
,
"Test set to 30 correctly"
);
$div
.
hide
();
equals
(
$div
.
height
(),
30
,
"Test hidden div"
);
$div
.
show
();
$div
.
height
(
-
1
);
// handle negative numbers by ignoring #1599
equals
(
$div
.
height
(),
30
,
"Test negative height ignored"
);
$div
.
css
(
"padding"
,
"20px"
);
equals
(
$div
.
height
(),
30
,
"Test padding specified with pixels"
);
$div
.
css
(
"border"
,
"2px solid #fff"
);
equals
(
$div
.
height
(),
30
,
"Test border specified with pixels"
);
//$div.css("padding", "2em");
//equals($div.height(), 30, "Test padding specified with ems");
//$div.css("border", "1em solid #fff");
//DISABLED - Opera 9.6 fails this test, returns 8
//equals($div.height(), 30, "Test border specified with ems");
//$div.css("padding", "2%");
//equals($div.height(), 30, "Test padding specified with percent");
$div
.
css
({
display
:
""
,
border
:
""
,
padding
:
""
,
height
:
"1px"
});
});
test
(
"addClass(String)"
,
function
()
{
expect
(
2
);
var
div
=
jQuery
(
"div"
);
...
...
test/unit/dimensions.js
View file @
e06da172
module
(
"dimensions"
);
test
(
"width()"
,
function
()
{
expect
(
6
);
var
$div
=
jQuery
(
"#nothiddendiv"
);
$div
.
width
(
30
);
equals
(
$div
.
width
(),
30
,
"Test set to 30 correctly"
);
$div
.
hide
();
equals
(
$div
.
width
(),
30
,
"Test hidden div"
);
$div
.
show
();
$div
.
width
(
-
1
);
// handle negative numbers by ignoring #1599
equals
(
$div
.
width
(),
30
,
"Test negative width ignored"
);
$div
.
css
(
"padding"
,
"20px"
);
equals
(
$div
.
width
(),
30
,
"Test padding specified with pixels"
);
$div
.
css
(
"border"
,
"2px solid #fff"
);
equals
(
$div
.
width
(),
30
,
"Test border specified with pixels"
);
//$div.css("padding", "2em");
//equals($div.width(), 30, "Test padding specified with ems");
//$div.css("border", "1em solid #fff");
//DISABLED - Opera 9.6 fails this test, returns 8
//equals($div.width(), 30, "Test border specified with ems");
//$div.css("padding", "2%");
//equals($div.width(), 30, "Test padding specified with percent");
$div
.
css
({
display
:
""
,
border
:
""
,
padding
:
""
});
jQuery
(
"#nothiddendivchild"
).
css
({
padding
:
"3px"
,
border
:
"2px solid #fff"
});
equals
(
jQuery
(
"#nothiddendivchild"
).
width
(),
20
,
"Test child width with border and padding"
);
jQuery
(
"#nothiddendiv, #nothiddendivchild"
).
css
({
border
:
""
,
padding
:
""
,
width
:
""
});
});
test
(
"height()"
,
function
()
{
expect
(
5
);
var
$div
=
jQuery
(
"#nothiddendiv"
);
$div
.
height
(
30
);
equals
(
$div
.
height
(),
30
,
"Test set to 30 correctly"
);
$div
.
hide
();
equals
(
$div
.
height
(),
30
,
"Test hidden div"
);
$div
.
show
();
$div
.
height
(
-
1
);
// handle negative numbers by ignoring #1599
equals
(
$div
.
height
(),
30
,
"Test negative height ignored"
);
$div
.
css
(
"padding"
,
"20px"
);
equals
(
$div
.
height
(),
30
,
"Test padding specified with pixels"
);
$div
.
css
(
"border"
,
"2px solid #fff"
);
equals
(
$div
.
height
(),
30
,
"Test border specified with pixels"
);
//$div.css("padding", "2em");
//equals($div.height(), 30, "Test padding specified with ems");
//$div.css("border", "1em solid #fff");
//DISABLED - Opera 9.6 fails this test, returns 8
//equals($div.height(), 30, "Test border specified with ems");
//$div.css("padding", "2%");
//equals($div.height(), 30, "Test padding specified with percent");
$div
.
css
({
display
:
""
,
border
:
""
,
padding
:
""
,
height
:
"1px"
});
});
test
(
"innerWidth()"
,
function
()
{
expect
(
3
);
...
...
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