diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-25 19:49:50 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-25 19:49:50 -0400 |
commit | edb2286544270dc53550180e06668e61c231fb5d (patch) | |
tree | e89dae0250f8c57839e160d2a4d5cf7e104b562b /test/unit/dimensions.js | |
parent | 1d1cb582c0f744afaa51a63d374b9ffe0f58d1db (diff) | |
download | jquery-edb2286544270dc53550180e06668e61c231fb5d.tar.gz jquery-edb2286544270dc53550180e06668e61c231fb5d.zip |
Return null for outer/inner width/height calls on window/document. Fixes #7557.
Diffstat (limited to 'test/unit/dimensions.js')
-rw-r--r-- | test/unit/dimensions.js | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/test/unit/dimensions.js b/test/unit/dimensions.js index 641165f4f..83cc3908f 100644 --- a/test/unit/dimensions.js +++ b/test/unit/dimensions.js @@ -107,7 +107,13 @@ test("height() with function args", function() { }); test("innerWidth()", function() { - expect(4); + expect(8); + + equals(jQuery(window).innerWidth(), null, "Test on window without margin option"); + equals(jQuery(window).innerWidth(true), null, "Test on window with margin option"); + + equals(jQuery(document).innerWidth(), null, "Test on document without margin option"); + equals(jQuery(document).innerWidth(true), null, "Test on document with margin option"); var $div = jQuery("#nothiddendiv"); // set styles @@ -136,7 +142,13 @@ test("innerWidth()", function() { }); test("innerHeight()", function() { - expect(4); + expect(8); + + equals(jQuery(window).innerHeight(), null, "Test on window without margin option"); + equals(jQuery(window).innerHeight(true), null, "Test on window with margin option"); + + equals(jQuery(document).innerHeight(), null, "Test on document without margin option"); + equals(jQuery(document).innerHeight(true), null, "Test on document with margin option"); var $div = jQuery("#nothiddendiv"); // set styles @@ -165,7 +177,12 @@ test("innerHeight()", function() { }); test("outerWidth()", function() { - expect(7); + expect(11); + + equal( jQuery( window ).outerWidth(), null, "Test on window without margin option" ); + equal( jQuery( window ).outerWidth( true ), null, "Test on window with margin option" ); + equal( jQuery( document ).outerWidth(), null, "Test on document without margin option" ); + equal( jQuery( document ).outerWidth( true ), null, "Test on document with margin option" ); var $div = jQuery("#nothiddendiv"); $div.css("width", 30); @@ -195,7 +212,12 @@ test("outerWidth()", function() { }); test("outerHeight()", function() { - expect(7); + expect(11); + + equal( jQuery( window ).outerHeight(), null, "Test on window without margin option" ); + equal( jQuery( window ).outerHeight( true ), null, "Test on window with margin option" ); + equal( jQuery( document ).outerHeight(), null, "Test on document without margin option" ); + equal( jQuery( document ).outerHeight( true ), null, "Test on document with margin option" ); var $div = jQuery("#nothiddendiv"); $div.css("height", 30); |