Created
March 15, 2012 03:08
-
-
Save johnkpaul/2041617 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module("sticky scroll integration tests",{ | |
"setup":function(){ | |
this.$el = $("<div class='test-scroll'></div>"); | |
this.$el.appendTo(document.body); | |
}, | |
"expandDocumentBody":function($el){ | |
$(document.body).css("height","10000px"); | |
}, | |
"shrinkDocumentBody":function($el){ | |
$(document.body).css("height","auto"); | |
}, | |
"teardown":function(){ | |
this.$el.remove(); | |
} | |
}); | |
asyncTest("using real browser events, scrolled-off class is added when el is out of viewport", function(){ | |
this.expandDocumentBody(); | |
this.$el.stickyScroll(); | |
var self = this; | |
$(window).scrollTop(5000); | |
setTimeout(function(){ | |
equals(self.$el.hasClass("scrolled-off"), true); | |
self.shrinkDocumentBody(); | |
start(); | |
},0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment