[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/libraries/bootstrap/js/tests/unit/ -> bootstrap-alert.js (source)

   1  $(function () {
   2  
   3      module("bootstrap-alerts")
   4  
   5        test("should be defined on jquery object", function () {
   6          ok($(document.body).alert, 'alert method is defined')
   7        })
   8  
   9        test("should return element", function () {
  10          ok($(document.body).alert()[0] == document.body, 'document.body returned')
  11        })
  12  
  13        test("should fade element out on clicking .close", function () {
  14          var alertHTML = '<div class="alert-message warning fade in">'
  15            + '<a class="close" href="#" data-dismiss="alert">×</a>'
  16            + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
  17            + '</div>'
  18            , alert = $(alertHTML).alert()
  19  
  20          alert.find('.close').click()
  21  
  22          ok(!alert.hasClass('in'), 'remove .in class on .close click')
  23        })
  24  
  25        test("should remove element when clicking .close", function () {
  26          $.support.transition = false
  27  
  28          var alertHTML = '<div class="alert-message warning fade in">'
  29            + '<a class="close" href="#" data-dismiss="alert">×</a>'
  30            + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
  31            + '</div>'
  32            , alert = $(alertHTML).appendTo('#qunit-fixture').alert()
  33  
  34          ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
  35  
  36          alert.find('.close').click()
  37  
  38          ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
  39        })
  40  
  41  })


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1