aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJohann <[email protected]>2016-11-26 07:57:20 +0100
committerMark Otto <[email protected]>2016-11-25 22:57:20 -0800
commitce18a66809823966dc9b8748d54b2087f752ea52 (patch)
tree04c76e0c87c772ee5855c8bec450791be9381276 /js
parent990a901e52965c616bbcd4a1c075e2c7841c11fe (diff)
downloadbootstrap-ce18a66809823966dc9b8748d54b2087f752ea52.tar.xz
bootstrap-ce18a66809823966dc9b8748d54b2087f752ea52.zip
Add test unit to check logic of ignoreBackdropClick (#18245)
Diffstat (limited to 'js')
-rw-r--r--js/tests/unit/modal.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 2d5911af3..cd3c96b9e 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -174,6 +174,19 @@ $(function () {
.bootstrapModal('show')
})
+ QUnit.test('should not close modal when clicking outside of modal-content if data-backdrop="true"', function (assert) {
+ assert.expect(1)
+ var done = assert.async()
+
+ $('<div id="modal-test" data-backdrop="false"><div class="contents"/></div>')
+ .on('shown.bs.modal', function () {
+ $('#modal-test').trigger('click')
+ assert.ok($('#modal-test').is(':visible'), 'modal not hidden')
+ done()
+ })
+ .bootstrapModal('show')
+ })
+
QUnit.test('should close modal when escape key is pressed via keydown', function (assert) {
assert.expect(3)
var done = assert.async()