aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorXavi <xavi.rmz@gmail.com>2011-01-09 19:11:05 -0500
committerXavi <xavi.rmz@gmail.com>2011-01-09 19:11:05 -0500
commitd03d2e9f26f85366ad2e91b9e2c76a249d7bf7be (patch)
tree76e9a6c1cfc11c1b3176e42a85437c4a675a854f /test
parentfcf623786aeae20485e5253bd2b66c8758053646 (diff)
downloadjquery-d03d2e9f26f85366ad2e91b9e2c76a249d7bf7be.tar.gz
jquery-d03d2e9f26f85366ad2e91b9e2c76a249d7bf7be.zip
Bug 7931; Fixed bug that caused scrollTop and scrollLeft setters to return null when called on an empty jquery object
Diffstat (limited to 'test')
-rw-r--r--test/unit/offset.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index cfa14449b..66676def5 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -333,7 +333,7 @@ testoffset("table", function( jQuery ) {
});
testoffset("scroll", function( jQuery, win ) {
- expect(16);
+ expect(20);
var ie = jQuery.browser.msie && parseInt( jQuery.browser.version, 10 ) < 8;
@@ -379,6 +379,12 @@ testoffset("scroll", function( jQuery, win ) {
equals( jQuery(window).scrollLeft(), 0, "jQuery(window).scrollLeft() other window" );
equals( jQuery(document).scrollTop(), 0, "jQuery(window).scrollTop() other document" );
equals( jQuery(document).scrollLeft(), 0, "jQuery(window).scrollLeft() other document" );
+
+ // Tests scrollTop/Left with empty jquery objects
+ ok( jQuery().scrollTop(100) != null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
+ ok( jQuery().scrollLeft(100) != null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
+ ok( jQuery().scrollTop() === null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
+ ok( jQuery().scrollLeft() === null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
});
testoffset("body", function( jQuery ) {