bootstrap-source/bootstrap-3.0.3/js/tests/unit/affix.js
changeset 115 a9d04f5f5650
parent 54 0ded9d7748b7
equal deleted inserted replaced
114:6093dda9fe38 115:a9d04f5f5650
     1 $(function () {
       
     2 
       
     3     module("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('bs.affix').checkPosition()
       
    22         ok(!$affix.hasClass('affix'), 'affix class was not added')
       
    23       })
       
    24 
       
    25 })
       
Impressum Datenschutzerklärung