88
|
1 $(function () {
|
|
2
|
|
3 module("bootstrap-affix")
|
|
4
|
|
5 test("should provide no conflict", function () {
|
|
6 var affix = $.fn.affix.noConflict()
|
|
7 ok(!$.fn.affix, 'affix was set back to undefined (org value)')
|
|
8 $.fn.affix = affix
|
|
9 })
|
|
10
|
|
11 test("should be defined on jquery object", function () {
|
|
12 ok($(document.body).affix, 'affix method is defined')
|
|
13 })
|
|
14
|
|
15 test("should return element", function () {
|
|
16 ok($(document.body).affix()[0] == document.body, 'document.body returned')
|
|
17 })
|
|
18
|
|
19 test("should exit early if element is not visible", function () {
|
|
20 var $affix = $('<div style="display: none"></div>').affix()
|
|
21 $affix.data('affix').checkPosition()
|
|
22 ok(!$affix.hasClass('affix'), 'affix class was not added')
|
|
23 })
|
|
24
|
|
25 }) |