Sha256: 2cafecfa9ed910e3cd7f9c428227b371dc299e42f18f7ad39bb3886fcc2bfaa5

Contents?: true

Size: 1.46 KB

Versions: 16

Compression:

Stored size: 1.46 KB

Contents

$(function () {

    module("bootstrap-alerts")

      test("should be defined on jquery object", function () {
        ok($(document.body).alert, 'alert method is defined')
      })

      test("should return element", function () {
        ok($(document.body).alert()[0] == document.body, 'document.body returned')
      })

      test("should fade element out on clicking .close", function () {
        var alertHTML = '<div class="alert-message warning fade in">'
          + '<a class="close" href="#" data-dismiss="alert">×</a>'
          + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
          + '</div>'
          , alert = $(alertHTML).alert()

        alert.find('.close').click()

        ok(!alert.hasClass('in'), 'remove .in class on .close click')
      })

      test("should remove element when clicking .close", function () {
        $.support.transition = false

        var alertHTML = '<div class="alert-message warning fade in">'
          + '<a class="close" href="#" data-dismiss="alert">×</a>'
          + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
          + '</div>'
          , alert = $(alertHTML).appendTo('#qunit-fixture').alert()

        ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')

        alert.find('.close').click()

        ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
      })

})

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
spiderfw-1.0.1 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-1.0.0 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.39 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.38 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.37 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.35 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.34 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.33 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.32 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.31 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.30 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.29 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.28 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.27 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
spiderfw-0.6.26 apps/core/components/public/bootstrap/js/tests/unit/bootstrap-alert.js
fennec-2.0.0 vendor/assets/javascripts/tests/unit/bootstrap-alert.js