From 57768d7ea9486f9fcf83701131880405e2fc01cf Mon Sep 17 00:00:00 2001 From: fat Date: Wed, 17 Jul 2013 23:01:33 -0700 Subject: fix #7660 --- js/tests/unit/modal.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 9187b5e23..90762ea90 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -134,4 +134,23 @@ $(function () { }) .modal("show") }) + + test("should close modal when clicking outside of modal-content", function () { + stop() + $.support.transition = false + var div = $("") + div + .bind("shown.bs.modal", function () { + ok($('#modal-test').length, 'modal insterted into dom') + $('.contents').click() + ok($('#modal-test').is(":visible"), 'modal visible') + $('#modal-test').click() + }) + .bind("hidden.bs.modal", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("show") + }) }) -- cgit v1.2.3