From 4642156cbc6da4a9e25dce2168f2fb9b726de042 Mon Sep 17 00:00:00 2001 From: Thomas Park Date: Tue, 6 Aug 2013 15:19:12 -0400 Subject: unignore bower_components --- .../bootstrap/js/tests/unit/bootstrap-alert.js | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 2/bower_components/bootstrap/js/tests/unit/bootstrap-alert.js (limited to '2/bower_components/bootstrap/js/tests/unit/bootstrap-alert.js') diff --git a/2/bower_components/bootstrap/js/tests/unit/bootstrap-alert.js b/2/bower_components/bootstrap/js/tests/unit/bootstrap-alert.js new file mode 100644 index 00000000..9a6b514c --- /dev/null +++ b/2/bower_components/bootstrap/js/tests/unit/bootstrap-alert.js @@ -0,0 +1,62 @@ +$(function () { + + module("bootstrap-alerts") + + test("should provide no conflict", function () { + var alert = $.fn.alert.noConflict() + ok(!$.fn.alert, 'alert was set back to undefined (org value)') + $.fn.alert = alert + }) + + 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 = '
' + + '×' + + '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + + '
' + , 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 = '
' + + '×' + + '

Holy guacamole! Best check yo self, you\'re not looking too good.

' + + '
' + , 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') + }) + + test("should not fire closed when close is prevented", function () { + $.support.transition = false + stop(); + $('
') + .bind('close', function (e) { + e.preventDefault(); + ok(true); + start(); + }) + .bind('closed', function () { + ok(false); + }) + .alert('close') + }) + +}) \ No newline at end of file -- cgit v1.2.3