info@54: $(function () { info@54: info@54: module("scrollspy") info@54: info@54: test("should provide no conflict", function () { info@54: var scrollspy = $.fn.scrollspy.noConflict() info@54: ok(!$.fn.scrollspy, 'scrollspy was set back to undefined (org value)') info@54: $.fn.scrollspy = scrollspy info@54: }) info@54: info@54: test("should be defined on jquery object", function () { info@54: ok($(document.body).scrollspy, 'scrollspy method is defined') info@54: }) info@54: info@54: test("should return element", function () { info@54: ok($(document.body).scrollspy()[0] == document.body, 'document.body returned') info@54: }) info@54: info@54: test("should switch active class on scroll", function () { info@54: var sectionHTML = '
' info@54: , $section = $(sectionHTML).append('#qunit-fixture') info@54: , topbarHTML ='
' info@54: + '
' info@54: + '
' info@54: + '

Bootstrap

' info@54: + '' info@54: + '
' info@54: + '
' info@54: + '
' info@54: , $topbar = $(topbarHTML).scrollspy() info@54: info@54: ok($topbar.find('.active', true)) info@54: }) info@54: info@54: })