diff options
| author | Lucas Banegas <[email protected]> | 2017-10-04 08:58:02 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-10-04 08:58:02 -0300 |
| commit | 2729d81832a8d8210996e38cdf86922a28a681e9 (patch) | |
| tree | 2ad74f0b5c701ec0099fe4d3d8ba095d6fe002f0 | |
| parent | d8d13263645085677886db31205e1b6171325ded (diff) | |
| parent | 47968c8126027c079e9a54c71a63b5dfaf3c0bda (diff) | |
| download | bootstrap-2729d81832a8d8210996e38cdf86922a28a681e9.tar.xz bootstrap-2729d81832a8d8210996e38cdf86922a28a681e9.zip | |
Merge pull request #2 from lucascono/v4-dev-modal-unit-test
Unit test for modal bug fix
| -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 e026cd7f1..d55a552ad 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') + }) }) |
