aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortimmywil <timmywillisn@gmail.com>2011-12-12 10:22:38 -0500
committertimmywil <timmywillisn@gmail.com>2011-12-12 10:42:10 -0500
commit9bea2167c434d5b97643f53da16b04927dc02a7d (patch)
treefcdec9b20a4e64a24d86490c5d74081d1d9b0adc /test
parent605e4bb1e67975855cb212ce68941419fcf88cec (diff)
downloadjquery-9bea2167c434d5b97643f53da16b04927dc02a7d.tar.gz
jquery-9bea2167c434d5b97643f53da16b04927dc02a7d.zip
When the width/height computed unit is not pixels, return that instead. Fixes #10782.
- Reordered some of css.js in preparation for jshint undef.
Diffstat (limited to 'test')
-rw-r--r--test/unit/css.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/unit/css.js b/test/unit/css.js
index 0eec26774..8e7f8ec10 100644
--- a/test/unit/css.js
+++ b/test/unit/css.js
@@ -1,13 +1,17 @@
module("css", { teardown: moduleTeardown });
test("css(String|Hash)", function() {
- expect( 44 );
+ expect( 46 );
- equal( jQuery("#qunit-fixture").css("display"), "block", "Check for css property \"display\"");
+ equal( jQuery("#qunit-fixture").css("display"), "block", "Check for css property \"display\"" );
+
+ ok( jQuery("#nothiddendiv").is(":visible"), "Modifying CSS display: Assert element is visible" );
+ jQuery("#nothiddendiv").css({ display: "none" });
+ ok( !jQuery("#nothiddendiv").is(":visible"), "Modified CSS display: Assert element is hidden" );
+ var $child = jQuery("#nothiddendivchild").css({ width: "20%", height: "20%" });
+ 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" );
- ok( jQuery("#nothiddendiv").is(":visible"), "Modifying CSS display: Assert element is visible");
- jQuery("#nothiddendiv").css({display: "none"});
- ok( !jQuery("#nothiddendiv").is(":visible"), "Modified CSS display: Assert element is hidden");
jQuery("#nothiddendiv").css({display: "block"});
ok( jQuery("#nothiddendiv").is(":visible"), "Modified CSS display: Assert element is visible");
ok( jQuery(window).is(":visible"), "Calling is(':visible') on window does not throw an error in IE.");