diff options
author | lucascono <lucasconobanegas@gmail.com> | 2017-10-04 14:55:40 +0300 |
---|---|---|
committer | lucascono <lucasconobanegas@gmail.com> | 2017-10-04 14:55:40 +0300 |
commit | 47968c8126027c079e9a54c71a63b5dfaf3c0bda (patch) | |
tree | 6ec920700315b3ade86fb6da062224ce922ed09a /js/tests | |
parent | cc2f5f71aedefce01e6c977661af7dc9840a8397 (diff) |
Unit test for modal bug fix
Unit test for pull request #24240
Diffstat (limited to 'js/tests')
-rw-r--r-- | js/tests/unit/modal.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index e026cd7f14..d55a552ade 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -673,4 +673,17 @@ $(function () { $toggleBtn.trigger('click') setTimeout(done, 500) }) + + QUnit.test('should not try to open a modal which is already visible', function (assert) { + assert.expect(1) + var done = assert.async() + var count = 0 + + $('<div id="modal-test"/>').on('shown.bs.modal', function () { + count++ + }).on('hidden.bs.modal', function () { + assert.strictEqual(count, 1, 'show() runs only once') + done() + }).bootstrapModal('show').bootstrapModal('show').bootstrapModal('hide') + }) }) |