aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorfat <[email protected]>2013-07-17 23:01:33 -0700
committerfat <[email protected]>2013-07-17 23:01:33 -0700
commit57768d7ea9486f9fcf83701131880405e2fc01cf (patch)
treec4e00ab91596566e4e707cb49e4e28871257d802 /js/tests
parent6387d8d5cccca1af3767258d6b38394c9f89afae (diff)
downloadbootstrap-57768d7ea9486f9fcf83701131880405e2fc01cf.tar.xz
bootstrap-57768d7ea9486f9fcf83701131880405e2fc01cf.zip
fix #7660
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/modal.js19
1 files changed, 19 insertions, 0 deletions
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 id='modal-test'><div class='contents'></div></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")
+ })
})