3
module("bootstrap-alerts")
5
test("should be defined on jquery object", function () {
6
ok($(document.body).alert, 'alert method is defined')
9
test("should return element", function () {
10
ok($(document.body).alert()[0] == document.body, 'document.body returned')
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>'
18
, alert = $(alertHTML).alert()
20
alert.find('.close').click()
22
ok(!alert.hasClass('in'), 'remove .in class on .close click')
25
test("should remove element when clicking .close", function () {
26
$.support.transition = false
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>'
32
, alert = $(alertHTML).appendTo('#qunit-fixture').alert()
34
ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
36
alert.find('.close').click()
38
ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
b'\\ No newline at end of file'