Skip to content

Instantly share code, notes, and snippets.

@johnkpaul
Created March 15, 2012 01:07
Show Gist options
  • Save johnkpaul/2040934 to your computer and use it in GitHub Desktop.
Save johnkpaul/2040934 to your computer and use it in GitHub Desktop.
module("sticky scroll unit tests",{
"setup":function(){
this.$el = $("<div></div>");
},
"getStickyScrollPlugin":function($el){
return $.data($el.get(0), "plugin_stickyScroll");
}
});
test("sticky scroll default class is scrolled-off", function(){
this.$el.stickyScroll();
var actualClass = this.getStickyScrollPlugin(this.$el).options["class"];
same(actualClass, "scrolled-off");
});
test("sticky scroll class can be overriden", function(){
var newClass = "scrolled-off-fuh-real";
this.$el.stickyScroll({"class":newClass});
same(this.getStickyScrollPlugin(this.$el).options["class"], newClass);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment