aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/dimensions.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/dimensions.js')
-rw-r--r--test/unit/dimensions.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js
index 85a69cdb7..6b0c9c798 100644
--- a/test/unit/dimensions.js
+++ b/test/unit/dimensions.js
@@ -284,6 +284,30 @@ QUnit.test( "outerHeight()", function( assert ) {
div.remove();
} );
+QUnit.test( "fractional getters", function( assert ) {
+ assert.expect( 8 );
+
+ var elem = jQuery( "<div>" ).css( {
+ width: "10.5px",
+ height: "20.5px",
+ border: "10px solid white",
+ padding: "2px",
+ margin: "3px"
+ } );
+
+ elem.appendTo( "#qunit-fixture" );
+
+ assert.strictEqual( elem.width(), 10.5, "width supports fractions" );
+ assert.strictEqual( elem.innerWidth(), 14.5, "innerWidth supports fractions" );
+ assert.strictEqual( elem.outerWidth(), 34.5, "outerWidth supports fractions" );
+ assert.strictEqual( elem.outerWidth( true ), 40.5, "outerWidth( true ) supports fractions" );
+
+ assert.strictEqual( elem.height(), 20.5, "height supports fractions" );
+ assert.strictEqual( elem.innerHeight(), 24.5, "innerHeight supports fractions" );
+ assert.strictEqual( elem.outerHeight(), 44.5, "outerHeight supports fractions" );
+ assert.strictEqual( elem.outerHeight( true ), 50.5, "outerHeight( true ) supports fractions" );
+} );
+
QUnit.test( "child of a hidden elem (or unconnected node) has accurate inner/outer/Width()/Height() see trac-9441 trac-9300", function( assert ) {
assert.expect( 16 );