info@54: $(function () { info@54: info@54: module("affix") info@54: info@54: test("should provide no conflict", function () { info@54: var affix = $.fn.affix.noConflict() info@54: ok(!$.fn.affix, 'affix was set back to undefined (org value)') info@54: $.fn.affix = affix info@54: }) info@54: info@54: test("should be defined on jquery object", function () { info@54: ok($(document.body).affix, 'affix method is defined') info@54: }) info@54: info@54: test("should return element", function () { info@54: ok($(document.body).affix()[0] == document.body, 'document.body returned') info@54: }) info@54: info@54: test("should exit early if element is not visible", function () { info@54: var $affix = $('
').affix() info@54: $affix.data('bs.affix').checkPosition() info@54: ok(!$affix.hasClass('affix'), 'affix class was not added') info@54: }) info@54: info@54: })