aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2011-04-12 16:13:56 -0400
committerJohn Resig <jeresig@gmail.com>2011-04-12 16:13:56 -0400
commitf1d75edec70783d67f0e11459f0a2187d98cc553 (patch)
treed9e66e3d2788dd44df32ed64df8004426aa02c1d /test
parent978c0655550ffbe32d977dbc997082e287c3a2b8 (diff)
parent135a384cf3e4cc3671de4cfcced20f294a5667a8 (diff)
downloadjquery-f1d75edec70783d67f0e11459f0a2187d98cc553.tar.gz
jquery-f1d75edec70783d67f0e11459f0a2187d98cc553.zip
Merge branch 'bug_7931' of https://github.com/Xavi-/jquery into Xavi--bug_7931
Conflicts: src/offset.js
Diffstat (limited to 'test')
-rw-r--r--test/unit/offset.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/unit/offset.js b/test/unit/offset.js
index f7bda29be..ea1a49332 100644
--- a/test/unit/offset.js
+++ b/test/unit/offset.js
@@ -344,7 +344,7 @@ testoffset("table", function( jQuery ) {
});
testoffset("scroll", function( jQuery, win ) {
- expect(16);
+ expect(22);
var ie = jQuery.browser.msie && parseInt( jQuery.browser.version, 10 ) < 8;
@@ -390,6 +390,14 @@ 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
+ notEqual( jQuery().scrollTop(100), null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
+ notEqual( jQuery().scrollLeft(100), null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
+ notEqual( jQuery().scrollTop(null), null, "jQuery().scrollTop(null) testing setter on empty jquery object" );
+ notEqual( jQuery().scrollLeft(null), null, "jQuery().scrollLeft(null) testing setter on empty jquery object" );
+ strictEqual( jQuery().scrollTop(), null, "jQuery().scrollTop(100) testing setter on empty jquery object" );
+ strictEqual( jQuery().scrollLeft(), null, "jQuery().scrollLeft(100) testing setter on empty jquery object" );
});
testoffset("body", function( jQuery ) {