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
8df348e9
Commit
8df348e9
authored
Oct 15, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No ticket: Test cleanup
parent
a339096d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
21 deletions
+9
-21
css.js
test/unit/css.js
+9
-21
No files found.
test/unit/css.js
View file @
8df348e9
...
...
@@ -3,7 +3,7 @@ if ( jQuery.css ) {
module
(
"css"
,
{
teardown
:
moduleTeardown
});
test
(
"css(String|Hash)"
,
function
()
{
expect
(
4
0
);
expect
(
4
2
);
equal
(
jQuery
(
"#qunit-fixture"
).
css
(
"display"
),
"block"
,
"Check for css property
\"
display
\"
"
);
...
...
@@ -13,7 +13,7 @@ test("css(String|Hash)", function() {
notEqual
(
$child
.
css
(
"width"
),
"20px"
,
"Retrieving a width percentage on the child of a hidden div returns percentage"
);
notEqual
(
$child
.
css
(
"height"
),
"20px"
,
"Retrieving a height percentage on the child of a hidden div returns percentage"
);
div
=
jQuery
(
"<div>"
);
div
=
jQuery
(
"<div
/
>"
);
// These should be "auto" (or some better value)
// temporarily provide "0px" for backwards compat
...
...
@@ -42,7 +42,7 @@ test("css(String|Hash)", function() {
equal
(
parseFloat
(
jQuery
(
"#nothiddendiv"
).
css
(
"width"
)),
0
,
"Test negative width set to 0"
);
equal
(
parseFloat
(
jQuery
(
"#nothiddendiv"
).
css
(
"height"
)),
0
,
"Test negative height set to 0"
);
equal
(
jQuery
(
"<div style='display: none;'>"
).
css
(
"display"
),
"none"
,
"Styles on disconnected nodes"
);
equal
(
jQuery
(
"<div style='display: none;'
/
>"
).
css
(
"display"
),
"none"
,
"Styles on disconnected nodes"
);
jQuery
(
"#floatTest"
).
css
({
"float"
:
"right"
});
equal
(
jQuery
(
"#floatTest"
).
css
(
"float"
),
"right"
,
"Modified CSS float using
\"
float
\"
: Assert float is right"
);
...
...
@@ -108,6 +108,12 @@ test("css(String|Hash)", function() {
// Test null
child
.
css
(
"font-size"
,
null
);
equal
(
child
[
0
].
style
.
fontSize
,
old
,
"Make sure font-size isn't changed on null."
);
strictEqual
(
child
.
css
(
"x-fake"
),
undefined
,
"Make sure undefined is returned from css(nonexistent)."
);
div
=
jQuery
(
"<div/>"
).
css
({
position
:
"absolute"
,
"z-index"
:
1000
}).
appendTo
(
"#qunit-fixture"
);
strictEqual
(
div
.
css
(
"z-index"
),
"1000"
,
"Make sure that a string z-index is returned from css('z-index') (#14432)."
);
});
test
(
"css() explicit and relative values"
,
29
,
function
()
{
...
...
@@ -197,16 +203,6 @@ test( "css() explicit and relative values", 29, function() {
equal
(
$elem
.
css
(
"opacity"
),
"1"
,
"'+=0.5' on opacity (params)"
);
});
test
(
"css(String) where values are z-index"
,
function
()
{
expect
(
1
);
var
$elem
=
jQuery
(
"<div>"
).
appendTo
(
"#qunit-fixture"
);
$elem
.
css
({
"position"
:
"absolute"
,
"z-index"
:
"1000"
});
strictEqual
(
$elem
.
css
(
"z-index"
),
"1000"
);
});
test
(
"css(String, Object)"
,
function
()
{
expect
(
19
);
var
j
,
div
,
display
,
ret
,
success
;
...
...
@@ -363,14 +359,6 @@ test("css(Object) where values are Functions", function() {
jQuery
(
"#cssFunctionTest"
).
remove
();
});
test
(
"css(String) where values are undefined"
,
function
()
{
expect
(
1
);
var
$elem
=
jQuery
(
"#nothiddendiv"
);
strictEqual
(
$elem
.
css
(
"test"
),
undefined
);
});
test
(
"css(Object) where values are Functions with incoming values"
,
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