Created
March 15, 2012 01:07
-
-
Save johnkpaul/2040934 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 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