diff options
author | Johann <johann.servoire@gmail.com> | 2016-12-02 20:52:19 +0300 |
---|---|---|
committer | Mark Otto <markd.otto@gmail.com> | 2016-12-02 20:52:19 +0300 |
commit | 297c47c3fdbb58e3d9824afdee83ef3c4b9d141a (patch) | |
tree | ca90559ff2025eca6400b6b88b3d609d91f9653f /js/tests/visual/collapse.html | |
parent | 1fb6d8c46a560e2e35295440721ba2929f9721b6 (diff) |
[V4] Throw error when a plugin is in transition (#17823)
* Throw error when a plugin is in transition
* Add unit tests about plugins in transition
Diffstat (limited to 'js/tests/visual/collapse.html')
-rw-r--r-- | js/tests/visual/collapse.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/tests/visual/collapse.html b/js/tests/visual/collapse.html index e13597984a..973d3c5ee6 100644 --- a/js/tests/visual/collapse.html +++ b/js/tests/visual/collapse.html @@ -61,5 +61,30 @@ <script src="../vendor/jquery.min.js"></script> <script src="../../dist/util.js"></script> <script src="../../dist/collapse.js"></script> + <script> + // JavaScript Test + $(function () { + testCollapseTransitionError() + }); + + // Should throw an error because carousel is in transition + function testCollapseTransitionError() { + var err = false + $('#collapseOne').on('hidden.bs.collapse', function (e) { + $(this).off('hidden.bs.collapse') + if (!err) { + alert('No error thrown for : testCollapseTransitionError') + } + }) + + try { + $('#collapseOne').collapse('hide').collapse('show') + } + catch (e) { + err = true + console.error(e.message) + } + } + </script> </body> </html> |