comparison static/bootstrap/js/tests/unit/bootstrap-affix.js @ 88:a5a3d454eac9

Updated Bootstrap.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 05 Apr 2013 08:08:12 -0700
parents
children
comparison
equal deleted inserted replaced
87:c0cf67362fb1 88:a5a3d454eac9
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 })