diff -r 6093dda9fe38 -r a9d04f5f5650 bootstrap-source/bootstrap-3.0.3/js/tests/unit/modal.js --- a/bootstrap-source/bootstrap-3.0.3/js/tests/unit/modal.js Sat Jan 18 12:34:36 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -$(function () { - - module("modal") - - test("should provide no conflict", function () { - var modal = $.fn.modal.noConflict() - ok(!$.fn.modal, 'modal was set back to undefined (org value)') - $.fn.modal = modal - }) - - test("should be defined on jquery object", function () { - var div = $("
") - ok(div.modal, 'modal method is defined') - }) - - test("should return element", function () { - var div = $("") - ok(div.modal() == div, 'document.body returned') - $('#modal-test').remove() - }) - - test("should expose defaults var for settings", function () { - ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed') - }) - - test("should insert into dom when show method is called", function () { - stop() - $.support.transition = false - $("") - .on("shown.bs.modal", function () { - ok($('#modal-test').length, 'modal inserted into dom') - $(this).remove() - start() - }) - .modal("show") - }) - - test("should fire show event", function () { - stop() - $.support.transition = false - $("") - .on("show.bs.modal", function () { - ok(true, "show was called") - }) - .on("shown.bs.modal", function () { - $(this).remove() - start() - }) - .modal("show") - }) - - test("should not fire shown when default prevented", function () { - stop() - $.support.transition = false - $("") - .on("show.bs.modal", function (e) { - e.preventDefault() - ok(true, "show was called") - start() - }) - .on("shown.bs.modal", function () { - ok(false, "shown was called") - }) - .modal("show") - }) - - test("should hide modal when hide is called", function () { - stop() - $.support.transition = false - - $("") - .on("shown.bs.modal", function () { - ok($('#modal-test').is(":visible"), 'modal visible') - ok($('#modal-test').length, 'modal inserted into dom') - $(this).modal("hide") - }) - .on("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - $('#modal-test').remove() - start() - }) - .modal("show") - }) - - test("should toggle when toggle is called", function () { - stop() - $.support.transition = false - var div = $("") - div - .on("shown.bs.modal", function () { - ok($('#modal-test').is(":visible"), 'modal visible') - ok($('#modal-test').length, 'modal inserted into dom') - div.modal("toggle") - }) - .on("hidden.bs.modal", function() { - ok(!$('#modal-test').is(":visible"), 'modal hidden') - div.remove() - start() - }) - .modal("toggle") - }) - - test("should remove from dom when click [data-dismiss=modal]", function () { - stop() - $.support.transition = false - var div = $("